Simpler Partial Page Refresh (PPR) with Dependent Fields

This entry might seem a bit trivial, but from experience I know that sometime new features that are added to the product are not detected by developers who just continue working in the "traditional way". Well here is a quick update on such a feature - PPR:

Way back in 2009 I did a blog entry that showed how to implement partial page rendering (PPR) in ADF by setting the partialTrigger attribute of a field to depend on another.

Somewhere along the way* ADF got more advanced, and today there's a simpler way to do this without the need to define the partialTrigger property for your calculated field. Instead you just define dependency between fields in the model layer (ADF BC) and your View layer automatically handles the update to the screen. This is driven by the default use of the "ppr" mode for the ChangeEventPolicy of iterators in your page's binding layer.

Here is a quick demo that shows you how to define a calculated field that depends on the values of two other fields, and have it automatically display the value when the other fields are set.

For the record here is the bit of groovy code used in the calculated field:

if (CommissionPct != null)
{return Salary * (1+CommissionPct);}
else
return Salary

* - I'm not exactly sure in which version of JDeveloper this became the default behavior, but I just looked in 11.1.1.7 and the default changeEventPolicy is not PPR for a page - but it seems like you can change it to ppr to get it working.

Comments:

Hello Shay,
I always set iterators changeEventPolicy to none, because leaving it PPR always beings errors like "Component is not set for active data. " and other misbehavior which vanishes with changeEventPolicy none.

Could you please comment on it?

Posted by lLya Cyclone on May 17, 2013 at 04:24 PM PDT #

Nice Shay ... that makes it easier than having to keep track of all those partialTriggers defined in the view layer and the issues that arise when you move components around to other regions.

Posted by Kyle Thomas on May 20, 2013 at 10:11 AM PDT #

ILya - I'm not familiar with these type of errors - if you have a reproducible test case, working with Oracle support through this can help.

Posted by Shay on May 20, 2013 at 10:27 AM PDT #

Post a Comment:
  • HTML Syntax: NOT allowed
About

me
I'm a Director of Product Management for the Oracle Java Development Tools.
Follow me:
Search

Archives
« April 2014
SunMonTueWedThuFriSat
  
1
2
3
4
5
6
7
8
9
10
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
   
       
Today