• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Tim Cooke
  • Devaka Cooray
Sheriffs:
  • Liutauras Vilda
  • paul wheaton
  • Rob Spoor
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Piet Souris
  • Mikalai Zaikin
Bartenders:
  • Carey Brown
  • Roland Mueller

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

 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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?
 
Ranch Hand
Posts: 327
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
 
I once met a man from Nantucket. He had a tiny ad
We need your help - Coderanch server fundraiser
https://coderanch.com/wiki/782867/Coderanch-server-fundraiser
reply
    Bookmark Topic Watch Topic
  • New Topic