X

Shay Shmeltzer's Oracle Development Tools Tips

Refreshing A Part of Your Page After a Pop-up

Shay Shmeltzer
Director of Product Management - Oracle

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.

Join the discussion

Comments ( 11 )
  • ramkumar Wednesday, June 11, 2008
    it is refreshing the table but the record whatever i added in popup it is not displaying to main page
  • ramkumar Wednesday, June 11, 2008
    ok
  • Bharathis Tuesday, June 17, 2008
    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 Wednesday, August 27, 2008
    That works!, very helpfull.
  • praj Friday, August 14, 2009
    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.
  • guest Wednesday, January 16, 2013

    Hi,

    I have a scenario where there is a popup with a button.On click of the button the popup closed and all the buttons in the parent page must be disabled.

    I tried the following:

    commandbutton1.setDisbled(true);

    AdfFacesContext.getCurrentInstance().addPartialTarget(commandbutton1);

    But it doesnt work.Am I missing something here ?


  • shay shmeltzer Wednesday, January 16, 2013

    guest - you can try adding the partialtrigger to the layout component in which the buttons are in.


  • newbee Monday, September 30, 2013

    Hi Shay

    i have a inputText with a popup.

    how can i refresh table or field that shows popup ?

    in this code

    public void backFromPopup(ReturnEvent returnEvent) {

    AdfFacesContext.getCurrentInstance().addPartialTarget(table);

    }

    i have not table.

    this is my source code...

    <af:popup id="p1">

    <af:menu text="menu 1" id="m2">

    <af:commandMenuItem text="reset"

    id="cmi2"

    action="#{testBean.resetval}"

    returnListener="#{testBean.refreshFieldAfterPopup}"/>

    </af:menu>

    </af:popup>


  • Shay Friday, October 4, 2013

    newbee, instead of "table" point to the component id you want to refresh - you'll need to have representation of it in your backing bean.

    (Sometime you might need to refresh the container around the textField)


  • guest Thursday, November 28, 2013

    Hi, I too am facing the same issue. My parent page is not getting refreshed after the dialog box closes. and i am not able to see the tables and data.

    please send me some sample code to achieve this.


  • Benign Tuesday, June 23, 2020
    return listener is not being called whenever I press the cancel icon on the adf page dialog, how can I call it. Thanks in advance.
Please enter your name.Please provide a valid email address.Please enter a comment.CAPTCHA challenge response provided was incorrect. Please try again.