Skip Headers
Oracle® Application Development Framework Developer's Guide
10g Release 3 (10.1.3)
B25386-01
  Go To Documentation Library
Home
Go To Product List
Solution Area
Go To Table Of Contents
Contents
Go To Index
Index

Previous
Previous
Next
Next
 

12.2 Validation, Conversion, and the Application Lifecycle

When data is submitted, the browser sends a request value to the server for each attribute. The request value is first stored in a component object in the ApplyRequestValues phase. If the value requires conversion (for example, if it is displayed as a String but stored as a DateTime object), the data is converted to the correct type. Then, if you set ADF Faces validation for any of the components that hold the data, the value is validated against the defined rules in the during the JSF Process Validation phase, before the value is applied to the model.

If validation or conversion fails, the lifecycle moves forward to the RenderResponse phase and a corresponding error message is displayed on the page. If validation and conversion are successful, then the UpdateModel phase starts and the validated and converted values are used to update the model.

At this point, if there are any model validation rules set in the model layer, the values are validated against those rules in the ADF ValidateModelUpdates phase. As with ADF Faces validation, if validation fails, the lifecycle moves forward to the RenderResponse phase. See Section 6.2.2.4, "The JSF and ADF Lifecycles" for more information. Figure 12-1 shows how validation and conversion work in the integrated JSF and ADF lifecycle.

Figure 12-1 Validation and Conversion in the Lifecycle

The phases that handle validation and conversion.

When a validation or conversion error occurs, the component (in the case of JSF validation or conversion) or attribute (in the case of ADF Model layer validation) whose validation or conversion failed places an associated error message in the queue and invalidates itself. The current page is then redisplayed with an error message. Both ADF Faces components and the ADF Model layer provide a way of declaratively setting these messages. For information about how other errors are handled by an ADF application, see Section 12.8, "Handling and Displaying Exceptions in an ADF Application".