First page Back Continue Last page Text

oracle adf workshop

Notes:


Creating a Method Validator

To create a Method validator for an entity, do the following:

1. Either for the entity object or for one of its attributes, invoke the Add Validation Rule editor as you do for any type of validation rule.

2. Select Method from the Rule Types drop-down list.

3. Select an existing method, or to create a new one, leave the Create and Select Method check box selected and type a name for your method in the Method Name field. Remember that your method name must begin with the word validate, or use the default name.

4. Click OK to add the method to your entity object’s Java class. You are then given the option to create the <EO>Impl.java file if it does not exist.

5. In the <EO>Impl.java file, edit the method to add your own validation code.

When you add a new Method validator, JDeveloper updates the XML component definition to reflect the new validation rule, adding a <MethodValidationBean> tag to the XML file.