Monday, August 1, 2011

ADF-BC Validations


This framework provides very good feature of validation. In ADF we can validate user inputs at different levels. Which are
  • Attribute level: Fires on value change.
  • Entity level: Fires on moving from one record to another.
  • Transaction level: Fires after attribute and entity level validations are complete. It validates Master-detail validations.
These validations are defined in Entity object and View object level. There are many rules of possible validations and ADF-BC provide lots of them. These validations rules are:
  • Compare: Attribute value compared with other attribute's value or an expression or a literal.
  • List: Value is validated against a list of values.
  • Key Exists: Its like a foreign key validator, it checks the value whether it exists or not. Like value for employee will check for the department to check whether it is present or not.
  • Regular Expressions: Value compared against provided regular expression. Like for email validation, Number Format validation.
  • Script Expression: Groovy expression are used to do validations.
  • Method Validator: When a method validator is created it adds a method in corresponding entityImpl calss. Like
public boolean validateEname(String ename) {  
return true;
}

No comments:

Post a Comment