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:

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

Posted by ramkumar on June 10, 2008 at 09:58 PM PDT #

ok

Posted by ramkumar on June 10, 2008 at 09:59 PM PDT #

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.

Posted by Bharathis on June 16, 2008 at 11:31 PM PDT #

That works!, very helpfull.

Posted by Aldrin Fuentes on August 27, 2008 at 07:36 AM PDT #

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.

Posted by praj on August 13, 2009 at 11:26 PM PDT #

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 ?

Posted by guest on January 15, 2013 at 09:15 PM PST #

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

Posted by shay shmeltzer on January 16, 2013 at 11:24 AM PST #

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>

Posted by newbee on September 30, 2013 at 05:15 AM PDT #

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)

Posted by Shay on October 04, 2013 at 03:30 PM PDT #

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.

Posted by guest on November 27, 2013 at 11:42 PM PST #

Post a Comment:
  • HTML Syntax: NOT allowed
About

me
I'm a Director of Product Management for the Oracle Java Development Tools.
Follow me:
Search

Archives
« April 2014
SunMonTueWedThuFriSat
  
1
2
3
4
5
6
7
8
9
10
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
   
       
Today