• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

popup window

 
Hari priya
Ranch Hand
Posts: 134
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all-

I am having a problem in tryign to get a pop up window.

When a user tries to update data in a table, teh action class calls a method that updates data. If teh table is updated, this method returns tru. Now, I would like to inform the user using a pop up window that the table has been updated. Can some one please let me know way to achieve this?

Thanks for your time
 
Marc Peabody
pie sneak
Sheriff
Posts: 4727
Mac Ruby VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I would find that very frustrating if I, as a user, had to close a popup window every time I changed a table. I recommend displaying a message on the results screen instead. Just my 2cents.

To accomplish what you asked you would have to use javascript in your results page to cause another window to be opened upon the onload event of the results page.
 
Hari priya
Ranch Hand
Posts: 134
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Marc for your response.

Your suggestion to display a message sound good to me too. My question is, I get the boolean value true / false when the record is updated. How will I access this variable in the javascript or jsp pages?

thanks again.
 
Merrill Higginson
Ranch Hand
Posts: 4864
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
One way to do this would be to instantiate an org.apache.struts.action.ActionMessages object, place an org.apache.struts.action.ActionMessage object in it using the add() method, and then calling the saveMessages() method from the Action class (It's declared in the Action superClass). Within your jsp, insert a <html:messages /> tag where you want the message to be displayed. It will only be displayed if there actually is a message to display.

Merrill
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic