Assigning Validators to UI Components

Once you create a validator or validatorChain, it appears in the appropriate validator type folder in the Validator perspective. To open the Validator perspective, select Window > Open Perspective > Nexaweb Validator.

image\img00639.gif

 

To view the validators created for a validator type, click + beside the validator type folder to expand the list.

image\img00640.gif

Either of the following icons appears beside the validators in the Validator view indicating:

Icon

Description

image\img00641.gif

Local validator. Indicates validators created in the currently opened UI file.

image\img00642.gif

Global validator. Indicates validators created in another UI file in this project.

image\img00643.gif

Custom Validator

 

You can assign validators to any textField or passwordField component in any file in the project in which you created the validator.

To assign a validator to a textField or passwordField component in any file in the project, follow these steps:

1. To open the Validator perspective, if not already open, select Window > Open Perspective > Nexaweb Validator.

2. Click + beside the type of validator to use to expand the list.

3. Drag a validator onto the textField or passwordField to validate.
The Set Validator Value and Invoke
r wizard appears.

image\img00644.gif

4. Select Attribute to Validate.
The Selected Validator and Component section of this wizard displays the currently selected component.

To select attribute for currently selected component

To select attribute for a different component

a. Click the arrow in the attribute picklist under Select a attribute and select the attribute of this component to validate.

b. Click Next

a. Click the Select from other component radio button.

b. Click Next.
The
Select attribute to validate dialog appears.

c. Select a component from the list on the left, and an attribute of that component from the list on the right.

d. Click Next.

 A summary appears, displaying your selections.

5. Click Finish.
Nexaweb Studio adds the validator to the
UI file.