File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
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


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
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
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
 
subject: How to refresh the parent page when the child window is submitted?
 
Similar Threads
target="_blank" attribute in form tag
javascript method called in jsf page, in dataTable.
Action on datatable row is executed on different row if table data is modifed in background
Check if updates were made before page unload
Executing a function before window.close