Dive into Oracle ADF

Send me a mail
 Dive into Oracle ADF   Click to see the XML version of this web page.   (Updated: 2/3/2008; 9:16:18 PM.)
Tips and tricks from Steve Muench on Oracle ADF Framework and JDeveloper IDE

Search blog with Google:
 

Search BC4J JavaDoc:
 

March 2005
Sun Mon Tue Wed Thu Fri Sat
    1 2 3 4 5
6 7 8 9 10 11 12
13 14 15 16 17 18 19
20 21 22 23 24 25 26
27 28 29 30 31    
Feb   Apr

Get Firefox!

Wednesday, March 16, 2005

Did you know that you can extend the set of built-in, declarative ADF entity validation rules by writing your own? Sure you can! Example #28 (Custom DateRange Validation Rule Bean with Custom Design Time Editor) over on my not yet documented examples page illustrates an example DateRangeRule validator bean that validates that a starting date attribute comes before an ending date attribute. It also illustrates how you can define a custom JavaBean Customizer panel to provide a custom editing experience for downstream users of your validator bean in the ADF Business Components design time. The DateRangeRule validator bean is linked to its custom DateRangeRuleCustomizer via the DateRangeRuleBeanInfo class. This is a standard JavaBeans programming technique. The project contains two deployment profiles: one produces a runtime JAR file with only the DateRangeRule, the other produces a design time JAR file with the BeanInfo and the Customizer for the rule. To use the date validation rule in any Business Components project, just add a library for these two JAR files, then visit the "Registered Rules" panel under the "Business Components" section of the project properties to (Add...) this test.rules.DateRangeRule as one of the rules you want to use, and give it the name "DateRange" Once you've done that, the DateRange validator will appear in the list for you to add to your entity objects on the "Validation" panel of the Entity Object editor. The custom editor panel allows you to pick the Start Date Attribute and the End Date Attribute from the list of date-type attributes in your entity object.


11:53:39 PM    



© Copyright 2008 Steve Muench.