What Happens When You Use a Custom Converter

6-12 Web User Interface Developers Guide for Oracle Application Development Framework To add ADF Faces validators: 1. In the Structure window, right-click the component for which you would like to add a validator.

2. In the context menu, choose Insert inside UI component, then ADF Faces to

insert an ADF Faces validator, or JSF Core to insert a JSF reference implementation validator.

3. Choose a validator tag for example, ValidateDateTimeRange.

4. In the Property Inspector, set values for the attributes, including any messages for validation errors. For additional help, right-click any of the attributes and choose Help . ADF Faces lets you customize the detail portion of a validation error message. By setting a value for a MessageDetailxyz attribute, where xyz is the validation error type for example, MessageDetailmaximum, ADF Faces displays the custom message instead of a default message, if validation fails.

6.5.2 What Happens at Runtime

When the user submits the page, ADF Faces checks the submitted value and runs conversion on any non-null value. The converted value is then passed to the validate method. If the value is empty, the required attribute of the component is checked and an error message is generated if indicated. If the submitted value is non-null, the validation process continues and all validators on the component are called in order of their declaration. ADF Faces validation is performed during the Process Validations phase. If any errors are encountered, the components are invalidated and the associated messages are added to the queue in the FacesContext instance. Once all validation is run on the components, control passes to the model layer, which runs the Validate Model Updates phase. As with the Process Validations phase, if any errors are encountered, the components are invalidated and the associated messages are added to the queue in the FacesContext instance. The lifecycle then goes to the Render Response phase and redisplays the current page. ADF Faces automatically displays an error icon next to the label of any input component that generated an error, and displays the associated messages in a popup window unless the af:message component inline attribute is set to true. Figure 6–2 shows a server-side validation error. RegExpValidator af:validateRegExp Validates the data using Java regular expression syntax. Note: To register a custom validator on a component, use a standard JSF f:validator tag. For information about using custom validators, see Section 6.6, Creating Custom JSF Validation. Note: ADF Faces provides extensions to the standard JSF validators, which have client-side support. Table 6–3 Cont. ADF Faces Validators Validator Tag Name Description