validateForm
Validates the fields of the specified form according to its defined validationExpression
.
Field Configurations
Key | Type | Description | Default Value |
---|---|---|---|
"params" (required) | Object | undefined | null |
Parameters
Key | Type | Description | Default Value |
---|---|---|---|
"async" | Boolean | Specifies whether the action should perform asynchronously. | null |
"form" | String | Name of the form that should be validated. If not specified, the form of the current view will be validated. | null |
"onError" | String | Event that will be fired if the form is invalid. | null |
"onErrorType" | OnErrorType | Type of the onError event. | "event" |
"onSuccess" | String | Event tha will be fired if the form is valid. | null |
"onSuccessType" | OnSuccessType | Type of the onSuccess event. | "event" |
Inherited
From Base Action
Base Action
Field Configurations
Key | Type | Description | Default Value |
---|---|---|---|
"dynamicParams" | Object | Dynamic params to retrieve data from a specific context e.g. a userSetting. | null |
"leadingDelimiter" | String | The leading mustache delimiter to use. | null |
"params" | Object,Array | Object containing the properties of the action. | null |
"trailingDelimiter" | String | The trailing mustache delimiter to use. | null |
"type" | String | Type name of the action. | null |
Examples
Example: Validate form
Goal: Check, if the user input is as expected.
The validation expression of the form layer favoriteNumber
only allows integers as input. If the input proves to be invalid, the specified validationErrorMessage
of the form layer will be displayed.
{
"type": "validateForm",
"params": {
"form": "favoriteNumber",
"onSuccess": "validInput",
"onError": "invalidInput"
}
}
The actions to be executed are specified in the actions
parameter, in this case a validateForm action.
Result:
A validateForm action has been created.