Adaptive Form Number input field component written in HTL.
- Provides the following type of input:
- html5 number input
- Custom constraint messages for the above types
- Styles
- Allows replacing this component with other component (as mentioned below).
The Form Text component uses the com.adobe.cq.forms.core.components.models.form.NumberInput
Sling Model for its Use-object.
The following properties are written to JCR for this Form Text component and are expected to be available as Resource
properties:
./jcr:title
- defines the label to use for this field./hideTitle
- if set totrue
, the label of this field will be hidden./name
- defines the name of the field, which will be submitted with the form data./default
- defines the default value of the field./description
- defines a help message that can be rendered in the field as a hint for the user./required
- if set totrue
, this field will be marked as required, not allowing the form to be submitted until the field has a value./requiredMessage
- defines the message displayed as tooltip when submitting the form if the value is left empty./readOnly
- if set totrue
, the field will be read only./minimum
- the minimum value that can be entered in this input./maximum
- the maximum value that can be entered in this input./minimumMessage
- the message showed to the user if the entered value is less than the minimum value./maximumMessage
- the message showed to the user if the entered value is more than the maximum value./leadDigits
- the max no of digits before decimal that can be entered if the type of field is Decimal../fracDigits
- the max no of digits after decimal that can be entered if the type of field is Decimal../displayFormat
- define the template for display pattern (Reference can be found here).
The component provides a core.forms.components.numberinput.v1.runtime
client library category that contains the Javascript runtime for the component.
It should be added to a relevant site client library using the embed
property.
The core.forms.components.numberinput.v1.runtime
client library also include a widget which helps in implementation of displayFormat
and editFormat
.
It also provides a core.forms.components.numberinput.v1.editor
editor client library category that includes
JavaScript handling for dialog interaction. It is already included by its edit dialog.
BLOCK cmp-adaptiveform-numberinput
ELEMENT cmp-adaptiveform-numberinput
ELEMENT cmp-adaptiveform-numberinput__label
ELEMENT cmp-adaptiveform-numberinput__label-container
ELEMENT cmp-adaptiveform-numberinput__widget
ELEMENT cmp-adaptiveform-numberinput__questionmark
ELEMENT cmp-adaptiveform-numberinput__shortdescription
ELEMENT cmp-adaptiveform-numberinput__longdescription
By placing the class names cmp-adaptiveform-numberinput__label
and cmp-adaptiveform-numberinput__questionmark
within the cmp-adaptiveform-numberinput__label-container
class, you create a logical grouping of the label and question mark elements. This approach simplifies the process of maintaining a consistent styling for both elements.
The following attributes must be added for the initialization of the number-input component in the form view:
data-cmp-is="adaptiveFormButton"
data-cmp-adaptiveformcontainer-path="${formstructparser.formContainerPath}"
The following are optional attributes that can be added to the component in the form view:
data-cmp-valid
having a boolean value to indicate whether the field is currently valid or notdata-cmp-required
having a boolean value to indicate whether the field is currently required or notdata-cmp-readonly
having a boolean value to indicate whether the field is currently readonly or notdata-cmp-active
having a boolean value to indicate whether the field is currently active or notdata-cmp-visible
having a boolean value to indicate whether the field is currently visible or notdata-cmp-enabled
having a boolean value to indicate whether the field is currently enabled or not
We support replace feature that allows replacing Reset Button component to any of the below components:
- Button
- Date Picker
- Email Input
- Reset Button
- Submit Button
- Telephone Input
- Text Box
- Text Input
- Vendor: Adobe
- Version: v1
- Compatibility: Cloud
- Status: production-ready