« JDeveloper Technology Preview 4 is Out | Main | Master with Two Details on the Same Page »

Refreshing A Part of Your Page After a Pop-up

A question from OTN:
You have a page that shows some data in a table, then you pop-up a dialog window where you change the data. Then you close the window - but how do you refresh the table to show the change?

The trick is to invoke a partial page render event on your table when you return from the pop-up.

So in your first page you have a button that looks something like:

< af:commandButton text="Submit" action="dialog:go"
useWindow="true" windowHeight="500"
windowWidth="500" returnListener="#{backing_show.backFromPopup}"/>


Note the returnListener property - this one points to the following piece of code in a backing bean:


public void backFromPopup(ReturnEvent returnEvent) {
AdfFacesContext.getCurrentInstance().addPartialTarget(table);
}


And the table is the backing bean binding to the object you want to refresh.

Comments (5)

it is refreshing the table but the record whatever i added in popup it is not displaying to main page

Bharathis:

could you please sent one example for this refreshing A part of your page.

i tried this one. but i cant get the value after the closing the popup.

Aldrin Fuentes:

That works!, very helpfull.

praj:

Hi,
I too am facing the same issue.
My parent page is not getting refreshed after the dialog box closes.
please send me some sample code to achieve this.

Post a comment

(If you haven't left a comment here before, you may need to be approved by the site owner before your comment will appear. Until then, it won't appear on the entry. Thanks for waiting.)