The Adaptable Form is defined in Predefined Config and then created dynamically by AdapTable as required.
It is currently used by these Modules:
|Alert||Form in the Alert Notification allows user to enter a different value if validation fails|
|Export||Additional information can be provided for Custom Destinations|
The full definition of the object is:
|buttons||Buttons to include in the Form|
|description||Additional information to appear in the Form|
|fields||Collection of Dynamic Fields to display|
|title||Title to appear in the Form|
An Adaptable Form will typically contain one of more Form Fields.
Each Field has a
fieldType property which will cause a different input control to be created based on its value, and a
defaultValue to display in the field.
The available input controls which can be created are: text, date, number, checkbox, and select
The object is defined as follows:
|defaultValue||Field Default Value - can be of type string, boolean, number|
|fieldType||Field Type: text, date, number, checkbox, select|
|label||Label to display in in the Field|
|name||Name of the Field|
|options||Items to populate the Select input|
An Adaptable Form can also contain a number of Adaptable Buttons.
For some Form use cases (e.g. Alerts) AdapTable will make sure that at least one 'OK' button is shown (which will close the Form)
The Adaptable Button is described at length here, and is defined as follows:
|buttonStyle||Style for Button - can be object or function thats provides a |
|disabled||Function that disables / enables the button based on its evaluation result|
|hidden||Function which sets whether Button is hidden|
|icon||Icon to display, requires string for URL, other props are optional|
|label||Label for Button - can be string or function that provides string|
|onClick||Function to invoke when button is clicked|
|tooltip||Tooltip for Button - can be string or function that provides string|
Each button has a
disabled property, which is a user-provided boolean function.
This can be used to perform validation on the whole form, e.g. by disabling an 'OK' button if certain requirements have not been met.
In the example below we provide a form which requires a value for BidOfferSpread to be provided between 20 and 100 for the 'OK' button to be enabled.