Michael Williams
Michael Williams

Reputation: 391

ADF Partial Page Refresh updating Form before Data Control returns new value

I have a set of master detail tables based on a single data source (Session Bean wrapping a web service call). The top level table (t1) shows opportunity data, the bottom level (t2) shows contacts for a particular opportunity. When an opportunity is selected in t1, the contacts associated with that opportunity are shown in t2. These tables work as desired.

I have a read only form (Panel Form Layout) based on a different data control (backed by a Session Bean that calls a LinkedIn API and a database table via EJB3 entities). The LinkedIn Session Bean method takes in a parameter which I get from the current row in t2. ( #{bindings.relatedContact.currentRow.dataProvider.id} ) I have set the PartialTriggers as 't2' on the form.

When the page loads for the first time, the first row (row A) of table t2 is selected and the form displays data associated with that row. If I select another row (row B), the Session Bean is called with the id value from the newly selected row, but the form displays row A's associated data. Subsequently, each time I select a row in t2, the bean is called with the new value, but the form displays data from the previously selected row.

I assume what is happening is that the form is refreshed (using stale data in the data control) and then the call to the session bean is made. I verified this using print statements and Thread.sleep() in the bean.

Is this correct behavior and how do I ensure the call to the bean happens before the form is refreshed?

I'm using JDeveloper version 11.1.2.2.0

Thanks

Michael

Upvotes: 1

Views: 8576

Answers (1)

Frank Nimphius-Oracle
Frank Nimphius-Oracle

Reputation: 711

By default the Refresh property setting of the iterators in the PageDef file is "deferred". For your use case its better to set it to "ifNeeded". So go to the iterator(s) for the detail Web Service (t2) and set the Refresh property to ifNeeded. This will fix your problem

Frank

Upvotes: 2

Related Questions