struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Frank Zammetti" <fzamm...@hotmail.com>
Subject RE: Popups with Struts.
Date Tue, 27 Jul 2004 22:45:40 GMT
Perhaps I'm not getting it, but...

Why couldn't you just add target="_blank" to your form?  Then, it would be 
submitted to your Struts Action, and the result (a JSP rendering I presume) 
would go to the new window.

If you need a little more control, another option is to make your page a 
frameset.  Create one of your frames with a size of 0.  Then, submit your 
form as usual, but target that hidden frame.  In your JSP, include an onLoad 
handler for the page that calls back to the frame that submitted the form to 
do your window open.

One last option is to not actually submit the form.  Instead, via JavaScript 
as a result of your Submit button being clicked, create a query string 
(i.e., ?name1=val1&nam2=val2 and so on), then do your usual JavaScript 
window.open, but for the URL you populate the window with, make it your 
Action, with the query string you constructed appended.  I actually do 
exactly this in one application I wrote.

Just some ideas to explore.  Let me know if you need further details to 
implement these...

Frank W. Zammetti
Chief Software Architect
Omnytex Technologies
www.omnytex.com


>From: "Angharad Stapleton" <a_stapleton@chiconi.com>
>Reply-To: "Struts Users Mailing List" <user@struts.apache.org>
>To: <user@struts.apache.org>
>Subject: Popups with Struts.
>Date: Fri, 23 Jul 2004 14:05:57 +0100
>
>Hi
>
>I have a form which I am using javascript to get information from the form
>and open up a new popup window with information. This is causing 
>limitations
>on the information I am passing through.
>
>I want to pass the information through a Struts action and have Struts then
>pass the information back and populate the popup window. I can't figure out
>how to do this. The only way I can think of at the moment is to store
>information in session, and pass control back to form page with a parameter
>that would tell it to open a pop-up window and get the information from the
>session. I'm thinking there is probably an easier way to do this.
>
>Thanks
>Angharad
>
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
>For additional commands, e-mail: user-help@struts.apache.org
>

_________________________________________________________________
Is your PC infected? Get a FREE online computer virus scan from McAfeeŽ 
Security. http://clinic.mcafee.com/clinic/ibuy/campaign.asp?cid=3963


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Mime
View raw message