Registering a Custom Validator on a Component

To register a custom validator on a component:

  1. In the Visual Editor, select the component on which you wish to register a custom validator.
  2. In the Component Palette, select the JSF Core page from the dropdown list, and then click Validator .

    A dialog appears for you to enter the identifier (ID) of the custom validator as it is registered in the application.

  3. Enter the validator ID and click OK.

    This inserts the f:validator tag in the page.

  4. (Optional) In the Component Palette, click Attribute in the JSF Core page.

    A dialog appears for you to enter the name and value of the component attribute to set. Click Help if you need information about using the dialog.

Code sample

<h:inputText id="name" 
             value="#{MyBean.name}" 
             size="10" ... >
  <f:validator validatorId="customValidator" />
  <f:attribute name="someName" value"someValue" />
</h:inputText>     

About Custom JSF Validators
Registering a Custom Converter or Validator in an Application
Referencing A Bean Method That Performs Validation
Registering a Standard Validator on a Component