To validate a component’s value using a particular validator, you need to register that validator on the component. You can do this in one of the following ways:
Nest the validator’s corresponding tag (shown in Table 8–3) inside the component’s tag. Using the LongRangeValidator describes how to use the validateLongRange tag. You can use the other standard tags in the same way.
Refer to a method that performs the validation from the component tag’s validator attribute.
Nest a validator tag inside the component tag and use either the validator tag’s validatorId attribute or its binding attribute to refer to the validator.
See Referencing a Method That Performs Validation for more information on using the validator attribute.
The validatorId attribute works similarly to the converterId attribute of the converter tag, as described in Converting a Component’s Value.
Keep in mind that validation can be performed only on components that implement EditableValueHolder because these components accept values that can be validated.