Tips and information about Oracle JDeveloper and Oracle ADF

Web Service Across Pages Called Twice

I first ran into this little trickery a few weeks back while helping some internal team with a POC, then yesterday this popped up again in another scenario, so here is a little thing that is a very common mistake when you first start to work with the ADF Data control.

The scenario is that you add a parameter page for the Web service in a JSF and a button that calls the Web service, and then you navigate to another page to show the results.
If your results are a collection of data, if you'll look carefully you'll notice that the Web service is actually invoked twice.
Once from the button, but then another time in a hidden way in the results page.
One thing you might encounter then is that the results that actually show up on the results page don't match your original parameters.

The solution is to have the first page just set the parameters and then pass them to the second page - where they are going to be used in the call to the Web service.

i got the same problem with the only difference, that I'm using only one page. I want to display the results directly under the ADF Form.
But the problem is, that I cant use this workarround, because the output fields are on the same page.
It everytime invokes the webservice after rendering the page. All output fields are updated after pressig the "submit"-button. (sending the parameters to the webservice and receive the response)

I tried a lot of stuff to avoid the first invoke, but I dont found out, how this setup can work.