Getting the previous value of an ADF Business Components Attribute

Sometimes in ADF land you need to check the value of an attribute that has just been changed...maybe you have a requirement that a new value must be within 10% of the previous value.  There is a neat solution to implement this as shown by Chris Muir in this ADF Insider Essential on our YouTube Channel.
Comments:

Hi Grant,

while I find the "getpostedattribute" method great, I do not agree that the groovy expression in the validation part of the movie delivers the same result. The getpostedattribute method clearly showed the database value or like Chris said the value since the last commit. To my knowledge the "oldvalue" groovy expression, returns the previous value and not the last committed value. Is this still correct or has this functionality been changed over the years?

Thanks.

Filip

Posted by Filip Huysmans on March 26, 2012 at 04:56 PM BST #

You are correct, the final method will return the "old" value meaning the value previous to the one it is now (which is not the same as what might be in the database). I don't think Chris defined exactly what the use case us, but what he has done is shown different options depending on whether you want a posted or changes value

Posted by Grant on March 28, 2012 at 10:02 AM BST #

Hi Filip

I would be interested to know how you're using the oldValue in validation? Are you using it in the validation rule, or just in the error message for the validation rule? And for which ever you're using, can you give us a concrete example please? In particular I'd be curious to know a validation rule that needs you to check against the last entered value rather than the last value posted to the database?

Thanks & regards,

CM.

Posted by Chris Muir on April 01, 2012 at 11:47 PM BST #

Hi Chris,

I'm, we are, using it in the validation itself. And you are right, in all the cases we need to compare with the version in the database and not the previous entered value. It is nice to see that there is a java equivalent allowing us to do this in a very easy way.
Has there already been an enhancement request to set the oldValue in the groovy expression also to be the database value and not the previous entered value?

Thx.

Filip.
Sorry for the late response, holidays ;-)

Posted by Filip Huysmans on April 09, 2012 at 04:01 PM BST #

Thanks for the feedback Filip, it is valuable. Grant and I are discussing this internally and will let you know the outcome.

Posted by Chris Muir on April 11, 2012 at 12:28 AM BST #

Hi Filip

For the record Oracle is working on adding a new implicit Groovy variable to retrieve the getpostedattribute, scheduled for a 11gR1 release sometime in the future. As usual we can't guarantee this will be delivered, but should make it into the 11.1.1.8.0 release.

Thanks for taking time out to post your comment to Grant's blog, we wouldn't have pursued this enhancement otherwise.

Cheers,

CM.

Posted by Chris Muir on June 07, 2012 at 07:12 AM BST #

Post a Comment:
  • HTML Syntax: NOT allowed
About

Tips, Tricks, Events and Information around Oracle JDeveloper, ADF, and Oracle Forms

Search

Archives
« April 2014
MonTueWedThuFriSatSun
 
1
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
    
       
Today