Jeff Holoman's Blog

Archive for February, 2012

Apex 4.1 Page Items to Submit

Posted by jholoman on February 26, 2012

I really haven’t taken the time to blog at all for quite some time. I made a resolution to do so more often, so here goes.

As I was setting up a quick example today on apex.oracle.com, I noticed a feature in the reports, the Page Items To Submit section beneath the Region source:

Image

I admittedly haven’t been through all the new features and so I checked out:

http://apex.oracle.com/pls/apex/f?p=52663:8:0:::::

The new attribute “Page Items to Submit” has been added to regions of type IR, Classic Report, Tabular Form and plug-ins having that feature enabled. The values of the specified page items will be submitted with a “Partial Page Refresh” request to set them in session state, so that they can be used in the WHERE clause of the regions SQL statement. A “Partial Page Refresh” can be triggered with the “Refresh” dynamic action, by changing the sorting or by paginating.

Very cool. If you are doing refreshes with ajax in your application, which I end up doing pretty frequently, you end up doing calls to set the session state of an item like

var get = new htmldb_Get(null, $v('pFlowid'),'APPLICATION_PROCESS=dummy',0);
get.add('P24_DEPTNO', $v('P24_DEPTNO'));
gReturn=get.get();
get=null;

Or perhaps you’ve been including a dynamic action of type Execute PL/SQL code that uses the existing Page Items to Submit functionality to save the value in session state:

Using this method, with a Change event attached to P24_DEPTNO, you’ll see that 2 calls are fired when deptno is changed:

The first is the call to set the value, then another to pull the report.

But with the new option we can consolidate these actions into one call, set the Page Items to Submit value to P24_DEPTNO in the report Region, and have just a single dynamic action to refresh the report:

And here’s the link section in the IR above:

DEMO here: http://apex.oracle.com/pls/apex/f?p=18507:24

Posted in Uncategorized | 3 Comments »