You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Jari Fredriksson <ja...@iki.fi> on 2006/02/13 17:07:10 UTC

Spawning a new window from Action.execute

Hello, new user here. New with struts, but looks good so far.

I have one special need now, though.. Would like to open something in a new 
window, after getting the data into form bean, and validated it.

This may not be a struts specific problem, but in case someone has ideas for 
it.

Specifically, I collect data in a form for a report. The report would be 
opened in a separate window alltogether, maybe closed, and restarted again 
with different parameters. The report may be a PDF-file too, so a separate 
window seems to be a solution for me.

The struts flow would be a "reload" for the original page, and that works 
fine. But how to "inject" stuff there between ;)

Regards,
jarif


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


Re: Spawning a new window from Action.execute

Posted by Jari Fredriksson <ja...@iki.fi>.
Tom Ansley wrote:
> Yes, I use javascript for the exact problem you mention.
>
> Here is the code I use for the different possible formats:
>
> <a
> href="/camp/jsp/report/buildReport.do?report_run=html"
> target="html_report"
> onclick="window.open('/camp/jsp/report/buildReport.do?report_run=html','html
> _report','resizable=yes,toolbar=no,directories=no,status=no,menubar=yes,scro
> llbars=yes');return false;"><bean:message
> key="report.type.html"/></a>
>

That way the Form gets not submitted, and the bean does not have the latest 
data on form.

It may not always be a problem, but I see it not perfect.. But it's a way to 
go it nothing better comes around..


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


RE: Spawning a new window from Action.execute

Posted by Tom Ansley <to...@gmail.com>.
Yes, I use javascript for the exact problem you mention.

Here is the code I use for the different possible formats:

				<a
href="/camp/jsp/report/buildReport.do?report_run=html" target="html_report"
onclick="window.open('/camp/jsp/report/buildReport.do?report_run=html','html
_report','resizable=yes,toolbar=no,directories=no,status=no,menubar=yes,scro
llbars=yes');return false;"><bean:message key="report.type.html"/></a>

-----Original Message-----
From: kalpesh modi [mailto:modi_kalpesh@yahoo.com] 
Sent: Monday, February 13, 2006 9:14 AM
To: Struts Users Mailing List
Subject: Re: Spawning a new window from Action.execute

You will need to use javascript. Let the javascript function call your
action class and open a new window.

HTH.

		
---------------------------------
 Yahoo! Mail
 Use Photomail to share photos without annoying attachments.


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


Re: Spawning a new window from Action.execute

Posted by kalpesh modi <mo...@yahoo.com>.
You will need to use javascript. Let the javascript function call your action class and open a new window.

HTH.

		
---------------------------------
 Yahoo! Mail
 Use Photomail to share photos without annoying attachments.