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:22:56 PM.)
Tips and tricks from Steve Muench on Oracle ADF Framework and JDeveloper IDE

Search blog with Google:
 

Search BC4J JavaDoc:
 

June 2007
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
May   Jul

Get Firefox!

Wednesday, June 13, 2007

Working remotely, I don't always know when our team is hiring, but Shay has just blogged that we're looking for a couple of new JDeveloper product manager to expand our team. Check it out if it sounds like something you might be interested in. You might need to scroll the page to the top to read the text of the post...


10:19:18 PM    



In JDeveloper 11g, in order to call methods on the current entity instance you'll need to reference the source property of the current object that gives you access to the entity instance being validated. For example, imagine that your entity object had the following four methods in it:

    public boolean isNewRow() {
        System.out.println("## isNewRow() accessed ##");
        return true;
    }
    public boolean isNewRow(int n) {
        System.out.println("## isNewRow(int n) accessed ##");
        return true;
    }
    public boolean testWhetherRowIsNew() {
        System.out.println("## testWhetherRowIsNew() accessed ##");
        return true;
    }
    public boolean testWhetherRowIsNew(int n) {
        System.out.println("## testWhetherRowIsNew(int n) accessed ##");
        return true;
    }

Then the following Groovy validation condition would trigger them all (one of them being triggered twice!)...

newRow &&
source.newRow &&
source.isNewRow(5) &&
source.testWhetherRowIsNew() &&
source.testWhetherRowIsNew(5)

Notice the slightly different syntax for the reference to a method whose name matches the JavaBeans property getter method naming pattern. That is, if a method is a non-boolean type and the method name is getXyzAbc() with no arguments, then you access its value as if it were a property named xyzAbc. For a boolean-valued property, the same holds but the JavaBean naming pattern for the getter method changes to recognize isXyzAbc() instead of getXyzAbc().

Notice that both newRow and source.newRow work to access the boolean-valued, JavaBeans getter-style method that has no arguments. If the method on your entity object does not match the JavaBeans getter method naming pattern, or it takes one or more arguments, then you must call it like a method using its complete name as shown in the example.

Running the example above and forcing entity validation to occur, you would see the following diagnostic output to the log window:

## isNewRow() accessed ##
## isNewRow() accessed ##
## isNewRow(int n) accessed ##
## testWhetherRowIsNew() accessed ##
## testWhetherRowIsNew(int n) accessed ##

1:56:04 PM    


Wilfred van der Deijl's article on Integrating Oracle Forms into Oracle ADF Faces is now live on OTN. It presents an interesting technique to seamlessly blend the two technologies...


11:37:47 AM    


© Copyright 2008 Steve Muench.