Creating a Validator Chain

You can create a validator chain to run a series of validators on the same or different fields in a UI file.

The validator chain provides a failFast Boolean attribute, which when set to true, causes the validator chain to stop executing as soon as any validator fails. You can specify onSuccess and onFailure behaviors for the chain in addition to setting these for each validator included in the chain. The chain succeeds if all the validators within it succeed.

If you set onSuccess and onFailure behaviors for the chain in addition to any or all of the validator included in the chain, users can potentially see messages for the success or failure of each validator in addition to seeing messages for the success or failure of the chain. 

You can include in a validatorChain a:

To create a validator chain, follow these steps.

1. Right click in a UI file and select Data > Create Data Validator.
The Create Data Validator wizard
appears.

2. Complete the Create Data Validator wizard similar to the following:

image\img00314.gif

Type: Click on validatorChain in the list of validators displayed on the left.

ID: Specify a unique ID for this validatorChain.

failFast: Specifies whether to stop execution of the chain upon failure of any validator within the chain. Set this attribute to change from default only. Default=true. If set to false, validator chain continues to execute until all validators within the chain execute no matter the result of any single validator in the chain.

onSuccess: Specifies an MCO or Macro event to run - for example, to display a success message - upon successful validation. Press Ctrl+space bar for the syntax for specifying an existing event handler. Or click Advanced to define a new event handler. See Connecting Business Logic to the User Interface for more information on creating an event handler.

onFailure: Specifies an MCO or Macro event to run - for example, to display a failed message if input does not meet validation requirements. Press Ctrl+space bar for the syntax for specifying an existing event handler. Or click Advanced to define a new event handler. See Connecting Business Logic to the User Interface for more information on creating an event handler.

 Click Next.
The Select Validators
dialog appears.

3. Complete the Select Validators dialog as follows:

image\img00315.gif

Select the validators to include in the chain using any of the following methods:

Click Select All to select all of the validators listed.

Click the check box beside each validator in the list to include in the chain.

Click Insert to launch the Create Validator wizard to create a new validator to include in the chain.

 

4. When you finish selecting validators, click Next.
A Vali
datorChainSummary dialog appears.

5. Click Next.
The Bind validator with event attribute
dialog appears

6. Select the component and component attribute to invoke the validatorChain.
To review your selection in a summary
dialog, click Next.
To add the vali
dator, click Finish.
The validatorChain appears in the validatorChain folder in the Validator view.