GeeCON Prague 2014*
The moose likes JSF and the fly likes How to refresh the parent page when the child window is submitted? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


JavaRanch » Java Forums » Java » JSF
Bookmark "How to refresh the parent page when the child window is submitted?" Watch "How to refresh the parent page when the child window is submitted?" New topic
Author

How to refresh the parent page when the child window is submitted?

r st
Greenhorn

Joined: Jun 30, 2009
Posts: 1
Hi,

I have a main page with a datatable. Also I have a link which opens a popup window for adding a new raw in the datatable.
I want when I click the Add button in the window, the data to be added in the database, the window to close and the page containing the datatable to be refreshed.
The button is like this:
<h:commandButton action="#{itemBean.actionAddItem}" value="Add" onclick="window.opener.location.reload();window.close();" >

When I click the button the data is added in the database and the window is closed, the problem is that the main page is not refreshed. I know that the onclick is executed before the action, so therefore the page is not refreshed with the new value. What can I do?
Also in this way, I cannot validate the form from the window, because the window is closed before the validation messages are displayed.
Can anyone help me?
Jason Irwin
Ranch Hand

Joined: Jun 09, 2009
Posts: 327
I think this example shows what you want (or may give you some clues at least, it uses RichFaces)
http://eclipse.dzone.com/articles/an-introduction-to-jboss-richf


SCJP6
 
GeeCON Prague 2014
 
subject: How to refresh the parent page when the child window is submitted?