wood burning stoves
The moose likes Struts and the fly likes popup window Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "popup window" Watch "popup window" New topic

popup window

Hari priya
Ranch Hand

Joined: Mar 11, 2004
Posts: 134
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

Joined: Feb 05, 2003
Posts: 4727

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.

A good workman is known by his tools.
Hari priya
Ranch Hand

Joined: Mar 11, 2004
Posts: 134
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

Joined: Feb 15, 2005
Posts: 4864
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.


Consultant, Sima Solutions
I agree. Here's the link: http://aspose.com/file-tools
subject: popup window
jQuery in Action, 3rd edition