When you are dealing with big sets of data or complex queries you sometime want to prevent the automatic execution of a query that happens when you bind a table or form in an ADF page to a data control.
Common example is if you have a VO query that depends on a parameter and you have a single page where you let people insert the parameter (using executeWithParams for example) and see the data below it in a table.
The first time you run the page you don't want the table to be populated.
(This is quite a common question on the OTN discussion forum also).
The solution is to have a condition associated with the refresh condition of the iterator that displays the data in your page.
In the ADF Developer Guide for 10.1.3 it is explained under: Controlling Whether Data Appears Initially
And the achieve it by using the ${adfFacesContext.postback == true} expression.
In 11 there is a new variable that does the same it's name is adfFacesContext.initialRender and the EL you would use would be: #{!adfFacesContext.initialRender}
To try it out take the VO based on Departments and drop it on your page as a form - now run the page and you'll see data.
Now go into the binding editor and fill out the value #{!adfFacesContext.initialRender} for the iterator.

If you run the page again, the Form would be empty.
Comments (2)
thanks shay
Posted by Anonymous | January 18, 2009 11:04 PM
Posted on January 18, 2009 23:04
I am new to this technology and learning. Your tips are very intresting and helpful.
Sr
Posted by Shriram | January 31, 2009 5:03 PM
Posted on January 31, 2009 17:03