Tuesday, 5 March 2013

HOW TO DO VALIDATION IN ADF MODEL LAYER

In the model layer, ADF Model validation rules can be set for a binding's attribute on a particular page. When a user edits or enters data in a field and submits the form, the bound data is validated against any set rules and conditions. If validation fails, the application displays an error message.

Defining Validation Rules in the ADF Model Layer:

  • You can configure ADF Model validation for a binding's attributes on the page definition file. Validation rules in the model layer are executed for a binding's attribute on a particular page when the containing form is submitted.
  • You can optionally set the skipValidation property to true to bypass the ADF Model validation. You can set skipValidation to skipDataControls to validate the bound objects without validating the transaction. For example, set skipValidation to skipDataControls if you have a table action that opens a popup window to accept data entries and you want to allow the view layer to validate those entries before the commit on the table. The skipValidation property can be found in the Property Inspector after you have selected the root node of the page definition file in the Structure window.

Validation Can be Done by following:
Validator Rule Name Description
Compare Compares the attribute's value with a literal value
List Validates whether or not the value is in a list of values
Range Validates whether or not the value is within a range of values
Length Validates the value's character or byte size against a size and operand (such as greater than or equal to)
Regular Expression Validates the data using Java regular expression syntax
Required Validates whether or not a value exists for the attribute


No comments:

Post a Comment