This week's book giveaway is in the Java 9 forum.
We're giving away four copies of Java 9 Modularity: Patterns and Practices for Developing Maintainable Applications and have Sander Mak & Paul Bakker on-line!
See this thread for details.
Win a copy of Java 9 Modularity: Patterns and Practices for Developing Maintainable Applications this week in the Java 9 forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

updating table in calling page after closing a dialog  RSS feed

 
Daniel Conner
Ranch Hand
Posts: 47
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have a JSF page that has a table full of data... In the table, there is a create new record button. By clicking on the create new record button a dialog is opened. Once you add the record and close the dialog box, the new record is added to the database, but the update is not shown in the table... Any idea on how to have the update to be shown in the table after the dialog is closed?
 
Eugene Abarquez
Ranch Hand
Posts: 211
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
By dialog box do you mean a javascript dialog box? Did you try refreshing the page if it shows the new added record? You might have to find a way to do a page refresh programmatically after you close the dialog.
 
Remko Strating
Ranch Hand
Posts: 893
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Just use a Ajax-request after you have done the update so the user wouldn't know that you're getting new values from the server.

I use AJAX4JSF for that.
 
Gabriel Claramunt
Ranch Hand
Posts: 375
Monad Scala
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
IIRC, I had a similar problem, my solution: after the dialog is submitted (so the data is persisted) I send a "refresh" to the main page through javascript.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!