File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes HTML, CSS and JavaScript and the fly likes Struts action triggered by onUnload event Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCA/OCP Java SE 7 Programmer I & II Study Guide this week in the OCPJP forum!
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Bookmark "Struts action triggered by onUnload event" Watch "Struts action triggered by onUnload event" New topic
Author

Struts action triggered by onUnload event

Joe Urbanek
Greenhorn

Joined: Jan 31, 2005
Posts: 15
I have an action class that triggers a pop up window displaying the results of the action. What I want to happen is when a user clicks a cancel button in the popup window I want the pop up window to transfer the control to the parent window and then trigger an action class that refreshes the parent window before the pop up closes, then I want the pop up window to close.

Any assistance is appreciated.
[ January 31, 2005: Message edited by: Joe Urbanek ]
Lasse Koskela
author
Sheriff

Joined: Jan 23, 2002
Posts: 11962
    
    5
Joe, I'm moving this thread over to our HTML and JavaScript forum since your problem is not specific to Struts (the solution is the same, regardless of whether the target is a Struts action, a JSP, or a regular Servlet).

Please continue the discussion over there.

Thanks.


Author of Test Driven (2007) and Effective Unit Testing (2013) [Blog] [HowToAskQuestionsOnJavaRanch]
Eric Pascarello
author
Rancher

Joined: Nov 08, 2001
Posts: 15376
    
    6
you can do

<body onunload="window.opener.reload()">

Eric
Joe Urbanek
Greenhorn

Joined: Jan 31, 2005
Posts: 15
.reload() does not seem to work with Firewox, it must be MicroSoft specific code.
Eric Pascarello
author
Rancher

Joined: Nov 08, 2001
Posts: 15376
    
    6
I perfer to use

window.location.href=window.location.href

Eric
 
jQuery in Action, 2nd edition
 
subject: Struts action triggered by onUnload event