Shay Shmeltzer's Oracle Development Tools Tips

  • January 9, 2009

Preventing Queries When Page First Loads

Shay Shmeltzer
Director of Product Management - Oracle

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.

Note - in some cases this solution is not enough - a safer bet would be to use a condition that checks if the parameter that you need to pass to the method is empty - see the blog entry - Delay Method Execution When Using ADF Binding

Join the discussion

Comments ( 22 )
  • Shriram Saturday, January 31, 2009
    I am new to this technology and learning. Your tips are very intresting and helpful.
  • guest Thursday, May 12, 2011
    I want to add myself in your weblog but I cannot.Is it possible to permit to login on your web log.I have a question about webservice how can I pass a webservice in adf 11g to a viewobject.
  • shay Thursday, May 12, 2011
    Guest - you don't need to login to my blog to post comment. As far as asking questions - you should post your questions on the JDeveloper OTN Discussion Forum - and I would suggest you provide there more details if you want people to give you an answer.
  • guest Tuesday, July 19, 2011


    this is not working , still form is showing some data.

  • Shay Wednesday, July 20, 2011

    guest - as the video shows it does work :-)

    I guess something specific in your scenario is different - if you need help with it try posting on the JDeveloper discussion forum on OTN.

  • guest Sunday, July 31, 2011

    This example is only effective in relation to whole pages and

    is not applicable for page fragments.

  • Shay Monday, August 1, 2011

    guest - you might want to use this approach instead for delaying the execution of queries: http://blogs.oracle.com/shay/2010/08/delay_method_execution_when_us.html

  • guest Wednesday, August 3, 2011


    I am using 11g and calling a web service (created in oracle) having mandatory parameters. I tried using "#{!adfFacesContext.initialRender}" and ${adfFacesContext.postback == true} without success. The web service is still getting called automatically in the background, which I can see in the server log. I also tried giving a 'refresh condition' for the binding like, #{bindings.InputId.inputValue ne null}. But even then I can see that the web service is indeed getting invoked. Any workaround solution to prevent this automatic calling will be helpful. This becomes more critical when calling web services which are not doing the fault handling and hence.

  • shay Thursday, August 4, 2011

    guest the #{bindings.InputId.inputValue ne null} method should work - note that in some situation you'll need to apply it to multiple iterators in your binding tab. You might want to also see if playing with the refresh property of the binding works. You can also set a breakpoint before the iterator in the binding tab and debug to see what is the value of the EL you use when you hit that point.

    If you still can't get it to behave please work with Oracle support that can look into the issue.

  • msjo Thursday, February 16, 2012

    Hi shay, I have exactly same trouble with above guest who called a web service.

    the web service is being called although using #{!adfFacesContext.initialRender} or using #{bindings.InputId.inputValue ne null}.

  • Shay Thursday, February 16, 2012

    msjo, this is not something that I can debug over the blog. Try setting up a breakpoint on the iterator and seeing when it is being executed and what are the values of your bindings.InputId.inputValue at that time.

  • Shay Thursday, February 16, 2012

    A note I got from Anand who had the previous issue (Aug 3):


    The workaround I found was to create a java proxy class over the web service and inside the method where you are invoking web service, put a small if condition to prevent the Web Service being called in case the parameter is invalid/null etc. Here is my code piece from the proxy class from which I created a data model:

    //DS_Id is my input to the web service

    public XXDSResponseType callXXDSWS(String DS_Id) {

    XXDSRequestType payload = new XXDSRequestType();

    XXDSResponseType res_type = new XXDSResponseType();

    try {

    XXDSABCSImpl_Service = new XXDSABCSImpl_Service();


    // Add your code to call the desired methods.

    if (StringUtils.isBlank(DS_Id)) {

    setError_msg("Please enter DS Id");


    else {


    res_type = XXDSABCSImpl.process(payload);

    // set a custom variable added to display the nessage in UI if required

    setError_msg("Web service invoked");


    } catch (FaultMessage e) {

    // set a custom variable added to display the nessage in UI if required



    return res_type;


    Hope this info helps.


  • guest Friday, February 17, 2012

    Hi shay,

    1. The strange thing is that an exception during calling webservice is thrown even though I set the break point before the iterator.

    2. Wrapping Java Class is not good solution. Framework should control this requirement.

  • shay Friday, February 17, 2012

    guest - I'm not sure about the structure of your page flow or your page - but maybe you are running into this:


    In any case as I indicated before - it might be better to post this on the OTN discussion forum, or even work this through with Oracle support.

  • Todor Kolev Sunday, February 19, 2012

    Hello Shay,

    I know it is strange but the mentioned approach simply doesn't work for me. I am creating a very simple project and only added are a table and executeWithParams form. Then I tried both #{!adfFacesContext.initialRender} and #{bindings.myInputTextId.inputValue ne null} without success. I am using Oracle IDE Have you got any ideas what might be the problem.

    Thanks in advance!

  • Fazel Tuesday, February 5, 2013

    i think that the right expression is #{!adfFacesContext.isInitialRender}

    no #{!adfFacesContext.initialRender}

  • guest Wednesday, October 9, 2013

    I agree with guest. I had the same issues with a datacontrol created from a web service. Quick workaround was to back the table and input and command button in a request bean. Set the table Rendered to false. In the backing bean, when command button is clicked, check for null or empty string in the inputtext object. Set table rendered when a value exists, otherwise not. What this does is prevent a call to the web service until a value is entered. It's a kludge, but a quick way to suppress the service call on page load. The other solutions given do not work.

  • Paul Davis Monday, January 6, 2014

    Hi Shay,

    This works only when the underlying VO don't have any name d bind variables.

    Is there any way to make it work even with Bind Variables?

  • Shay Monday, January 6, 2014

    Paul - try the other approach mentioned here:


  • guest Monday, January 27, 2014

    To improve on my comment of Oct 9 2013, I found all I need to do for a web service data control causing soap error on initial page load is set the table rendered property as so:

    #{bindings.arg0.inputValue ne null}

    where arg0.input value is the value you are trying to pass to the web service which on page load is null. No backing bean needed. If table is not rendered, web service is not called. Jdev

  • guest Thursday, August 6, 2015

    this happen when ADF form , not as table

  • guest Thursday, September 29, 2016

    I have a search field and table will be populated with search criteria. As and when i login to the page and refresh the page, the table is getting populated with wildcard search. But the same refresh of page will not load all records (rather it will show empty rows as the search field is empty) in the table if performed any search before the page refresh.

Please enter your name.Please provide a valid email address.Please enter a comment.CAPTCHA challenge response provided was incorrect. Please try again.