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 Criteria 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—A message that shows 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:
Renderer
Supported Validators
string
<None>, NotEmpty, ValidURL
integer
<None>, NotEmpty, (ValidInteger is default)
long
<None>, NotEmpty, (ValidNumeric is default)
number
<None>, NotEmpty, (ValidNumeric is default)
boolean
<None>, NotEmpty, (ValidBoolean is default)
location
<None>, NotEmpty, (ValidLocation is default)
html
<None>, NotEmpty
imagelink
<None>, NotEmpty
hyperlink
<None>, NotEmpty, ValidURL
datetime
<None>, NotEmpty, (ValidDatetime is default)
Validation Properties
In ThingWorx 9.3.4 or later, you can configure the following validation properties on the Validation panel. In earlier versions of the platform, these properties are available on the widget configuration dialog.
Property Name
Description
Base Type
Default Value
Localizable?
Bindable?
ShowValidationCriteria
Shows a criteria message for the required input when validation is applied.
BOOLEAN
False
N
N
ShowValidationFailure
Shows a failure message when the entered data fails the validation.
BOOLEAN
False
N
N
ShowValidationSuccess
Shows a success message when the validation is successful.
BOOLEAN
False
N
N
ValidationCriteriaIcon
Sets the icon to display within the criteria message.
IMAGELINK
N/A
N
N
ValidationFailureIcon
Sets the icon to display within the failure message.
IMAGELINK
N/A
N
N
ValidationSuccessIcon
Sets the icon to display within the success message.
IMAGELINK
N/A
N
N
Was this helpful?