|
| Copyright © Cloud Software Group, Inc. All Rights Reserved |
When a user enters a value in a form field, the value can be tested for validity. Multiple sets of criteria can be applied to the same data. The validity test is applied when a form is submitted. If test criteria are not met, a Validation Failed transition from the Show Form activity in the formflow can be used for further processing.If the Show Form activity has a Validation Failed transition, the transition is taken when validation fails and no violation message is displayed to the end user.If the Show Form activity has no Validation Failed transition, when form data is submitted the form is redisplayed in the browser window, with an error message at the top of the form. The message text is the Violation Message value for each validator used.
Table 4 Form Validation Types Validation Type Control-level validation This type of validation uses a predefined validator resource. Data specified in a single field is tested for a single criterion, such as whether a value has been specified or whether the data is numeric. Form-level validation This type of validation uses a predefined XPath validator resource. The resource applies the expression you specify to data in one or more form fields. For example, an XPath expression can check whether two fields contain incompatible values. The expression can test if value A is specified for one field. Value B cannot be specified for the other field. Formflow-level validation This type of validation uses externally stored validation criteria. For example, a database could be used to store availability information for event tickets. The Set Form Data activity is used, with an option for displaying custom violation message text to the end user. For more information, see Using Formflow-Level Validation.For basic validation checks, use control-level validation with predefined validator resources on the Form Validator palette. Each validator type can be used with a subset of form controls, depending on the type of data that can be specified. If multiple validator resources are configured for a single control, all validity tests are performed on the input data.
2. Drag a ControlValidators resource from the Forms Control palette to the control in the project panel. Click the ControlValidators icon in the project panel to select it.
4. Click Apply.Any validation errors, which can be specified in each validator, display at the top of the form at runtime.For more complicated validation checks, use form-level validation. For example, an XPath expression can test for a substring in a string value.
1. Select the form in the project panel in TIBCO Designer, and expand the hierarchy below the form. Every form has an empty FormValidators resource associated with it. This resource cannot be deleted.
2. Click the FormValidators resource in the project panel, then click the XPathValidator resource in the design panel.
3. In the Configuration tab, specify an XPath expression for validating data, and a message to display at runtime if validation criteria are not met.
4. Specify the Field Control Path, which is a path to the control that should be displayed in error mode. You can provide only one control, such as Form/Column1/TextField/.
5. Click Apply.
|
| Copyright © Cloud Software Group, Inc. All Rights Reserved |