Validating Input within the Grid
You can enable validation to verify that edits made to the grid data at run time follow valid formats. By default, the type of data that is supported within a grid column is determined by the data base type and the applied renderer. For example, you cannot enter alphabetic characters into column where the base type is set to NUMBER. You can enable data validation for the grid columns to apply additional validation rules when editing cell values at run time. For more information about the Grid renderers, see Grid Column Renderers and Formats.
To enable validation, perform the following steps:
1. In Mashup Builder, select the Grid widget on the canvas or using the Explorer panel.
2. On the Properties panel, click the configure widget button to open the widget configuration dialog box.
3. In the left pane, select a column that has editing enabled. The column options are displayed.
4. In the right pane, configure the following options:
Validation Error Expression—Type the expression to apply to the cell data. You an define regular expressions.
In addition to the validation expression, input is validated based on specified column renderer.
Validation Criteria Message—The message to show when editing a cell, before the validation is performed. and when the validation fails.
Validation Criteria Details—The a message to show additional details under the validation message.
Validation Success Message—The message to show when the data validation succeeds.
Validation Success Details—The message that shows additional details when the validation succeeds.
5. Repeat the previous step for any column that you want to edit, then click Done to close the dialog box.
6. On the Properties panel, configure the following validation properties:
To show the criteria message, enable ShowValidationCriteria, and then select an icon using the ValidationCriteriaIcon property.
To show the failure message, enable ShowValidationFailure, and then select an icon using the ValidationFailureIcon property.
To show the success message, enable ShowValidationSucess, and then select an icon using the ValidationSuccessIcon property.
7. Click Save. The validation is applied to the grid at run time.
Criteria Message
The criteria message is displayed before edits to the value are made. You can use the criteria message and details to provide users with instructions on what to enter. This text is also used when the input is not valid.
Failure Message
When the input is not valid, a failure message is displayed using the criteria message and details. In addition, a red border around the cell and a failure icon is used to indicate the failure state after the edit is done. You cannot save the edits to the grid until these failures are resolved.
The same message is used to show the input criteria and to the failure
Success Message
The success state is displayed when the input passes the validation:
Renderer Validators
By default, validation is applied for each column renderer type. You can specify the validator using JSON configuration for the grid, based on the renderer type. The following table lists the available validators for each renderer type:
Supported Validators
<None>, NotEmpty, ValidURL
<None>, NotEmpty, (ValidInteger is default)
<None>, NotEmpty, (ValidNumeric is default)
<None>, NotEmpty, (ValidNumeric is default)
<None>, NotEmpty, (ValidBoolean is default)
<None>, NotEmpty, (ValidLocation is default)
<None>, NotEmpty
<None>, NotEmpty
<None>, NotEmpty, ValidURL
<None>, NotEmpty, (ValidDatetime is default)
Was this helpful?