You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Dakota Jack <da...@gmail.com> on 2005/04/05 19:27:18 UTC

Popup Windows with Struts Actions

Anyone have some code on using JavaScript to open and close popup
windows with a Struts Action?  Thanks.

Jack

-- 
"You can lead a horse to water but you cannot make it float on its back."
~Dakota Jack~

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


Re: Popup Windows with Struts Actions

Posted by Dakota Jack <da...@gmail.com>.
THANX, Wiebe

On Apr 5, 2005 10:53 AM, Wiebe de Jong <wi...@shaw.ca> wrote:
> 
> Like this:
> 
> <html:link href="#"
> onclick="window.open('findAccountCSV.do','csv')">CSV</html:link>
> 
> Add the javascript to the onclick event. The first parameter is the action
> and the second is the window name. There are some additional optional
> parameters that you can add to control the window, etc.
> 
> Wiebe de Jong
> 
> -----Original Message-----
> From: Dakota Jack [mailto:dakota.jack@gmail.com]
> Sent: Tuesday, April 05, 2005 10:42 AM
> To: Frank W. Zammetti
> Cc: Struts Users Mailing List
> Subject: Re: Popup Windows with Struts Actions
> 
> No, have the popup url from the page be a struts action -- popup.do.
> 
> Jack
> 
> On Apr 5, 2005 10:37 AM, Frank W. Zammetti <fz...@omnytex.com> wrote:
> > Not sure what you mean... You mean open the popup from WITHIN an Action?
> >
> > --
> > Frank W. Zammetti
> > Founder and Chief Software Architect
> > Omnytex Technologies
> > http://www.omnytex.com
> >
> > On Tue, April 5, 2005 1:27 pm, Dakota Jack said:
> > > Anyone have some code on using JavaScript to open and close popup
> > > windows with a Struts Action?  Thanks.
> > >
> > > Jack
> > >
> > > --
> > > "You can lead a horse to water but you cannot make it float on its
> back."
> > > ~Dakota Jack~
> > >
> > > ---------------------------------------------------------------------
> > > To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> > > For additional commands, e-mail: user-help@struts.apache.org
> > >
> > >
> >
> >
> 
> --
> "You can lead a horse to water but you cannot make it float on its back."
> ~Dakota Jack~
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
> 
> 


-- 
"You can lead a horse to water but you cannot make it float on its back."
~Dakota Jack~

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


Re: Popup Windows with Struts Actions

Posted by Dakota Jack <da...@gmail.com>.
LOL -- heck, I should have said the other. 

On Apr 5, 2005 10:49 AM, Frank W. Zammetti <fz...@omnytex.com> wrote:
> Ah, good, I was going to yell at you if it was the other :)
> 
> myLeft = (screen.width) ? (screen.width - 1180) / 2 : 0;
> myTop = (screen.height) ? (screen.height - 924) / 2 : 0;
> myOpts = "resizable,scrollbars,width=1180,height=924,top=" + myTop +
> ",left=" + myLeft + ",";
> window.open('startup.toa', 'TOA', myOpts);
> 
> That's what I have in one of my apps... startup.toa is a mapping to an
> Action (a ForwardAction in this case, but I doubt that would make any
> difference).
> 
> --
> Frank W. Zammetti
> Founder and Chief Software Architect
> Omnytex Technologies
> http://www.omnytex.com
> 
> On Tue, April 5, 2005 1:41 pm, Dakota Jack said:
> > No, have the popup url from the page be a struts action -- popup.do.
> >
> > Jack
> >
> > On Apr 5, 2005 10:37 AM, Frank W. Zammetti <fz...@omnytex.com> wrote:
> >> Not sure what you mean... You mean open the popup from WITHIN an Action?
> >>
> >> --
> >> Frank W. Zammetti
> >> Founder and Chief Software Architect
> >> Omnytex Technologies
> >> http://www.omnytex.com
> >>
> >> On Tue, April 5, 2005 1:27 pm, Dakota Jack said:
> >> > Anyone have some code on using JavaScript to open and close popup
> >> > windows with a Struts Action?  Thanks.
> >> >
> >> > Jack
> >> >
> >> > --
> >> > "You can lead a horse to water but you cannot make it float on its
> >> back."
> >> > ~Dakota Jack~
> >> >
> >> > ---------------------------------------------------------------------
> >> > To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> >> > For additional commands, e-mail: user-help@struts.apache.org
> >> >
> >> >
> >>
> >>
> >
> >
> > --
> > "You can lead a horse to water but you cannot make it float on its back."
> > ~Dakota Jack~
> >
> 
> 


-- 
"You can lead a horse to water but you cannot make it float on its back."
~Dakota Jack~

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


Re: Popup Windows with Struts Actions

Posted by "Frank W. Zammetti" <fz...@omnytex.com>.
Ah, good, I was going to yell at you if it was the other :)

myLeft = (screen.width) ? (screen.width - 1180) / 2 : 0;
myTop = (screen.height) ? (screen.height - 924) / 2 : 0;
myOpts = "resizable,scrollbars,width=1180,height=924,top=" + myTop +
",left=" + myLeft + ",";
window.open('startup.toa', 'TOA', myOpts);

That's what I have in one of my apps... startup.toa is a mapping to an
Action (a ForwardAction in this case, but I doubt that would make any
difference).

-- 
Frank W. Zammetti
Founder and Chief Software Architect
Omnytex Technologies
http://www.omnytex.com

On Tue, April 5, 2005 1:41 pm, Dakota Jack said:
> No, have the popup url from the page be a struts action -- popup.do.
>
> Jack
>
> On Apr 5, 2005 10:37 AM, Frank W. Zammetti <fz...@omnytex.com> wrote:
>> Not sure what you mean... You mean open the popup from WITHIN an Action?
>>
>> --
>> Frank W. Zammetti
>> Founder and Chief Software Architect
>> Omnytex Technologies
>> http://www.omnytex.com
>>
>> On Tue, April 5, 2005 1:27 pm, Dakota Jack said:
>> > Anyone have some code on using JavaScript to open and close popup
>> > windows with a Struts Action?  Thanks.
>> >
>> > Jack
>> >
>> > --
>> > "You can lead a horse to water but you cannot make it float on its
>> back."
>> > ~Dakota Jack~
>> >
>> > ---------------------------------------------------------------------
>> > To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
>> > For additional commands, e-mail: user-help@struts.apache.org
>> >
>> >
>>
>>
>
>
> --
> "You can lead a horse to water but you cannot make it float on its back."
> ~Dakota Jack~
>


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


RE: Popup Windows with Struts Actions

Posted by Wiebe de Jong <wi...@shaw.ca>.
Like this:

<html:link href="#"
onclick="window.open('findAccountCSV.do','csv')">CSV</html:link>

Add the javascript to the onclick event. The first parameter is the action
and the second is the window name. There are some additional optional
parameters that you can add to control the window, etc.

Wiebe de Jong

-----Original Message-----
From: Dakota Jack [mailto:dakota.jack@gmail.com] 
Sent: Tuesday, April 05, 2005 10:42 AM
To: Frank W. Zammetti
Cc: Struts Users Mailing List
Subject: Re: Popup Windows with Struts Actions

No, have the popup url from the page be a struts action -- popup.do.

Jack

On Apr 5, 2005 10:37 AM, Frank W. Zammetti <fz...@omnytex.com> wrote:
> Not sure what you mean... You mean open the popup from WITHIN an Action?
> 
> --
> Frank W. Zammetti
> Founder and Chief Software Architect
> Omnytex Technologies
> http://www.omnytex.com
> 
> On Tue, April 5, 2005 1:27 pm, Dakota Jack said:
> > Anyone have some code on using JavaScript to open and close popup
> > windows with a Struts Action?  Thanks.
> >
> > Jack
> >
> > --
> > "You can lead a horse to water but you cannot make it float on its
back."
> > ~Dakota Jack~
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> > For additional commands, e-mail: user-help@struts.apache.org
> >
> >
> 
> 


-- 
"You can lead a horse to water but you cannot make it float on its back."
~Dakota Jack~

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


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


Re: Popup Windows with Struts Actions

Posted by Dakota Jack <da...@gmail.com>.
No, have the popup url from the page be a struts action -- popup.do.

Jack

On Apr 5, 2005 10:37 AM, Frank W. Zammetti <fz...@omnytex.com> wrote:
> Not sure what you mean... You mean open the popup from WITHIN an Action?
> 
> --
> Frank W. Zammetti
> Founder and Chief Software Architect
> Omnytex Technologies
> http://www.omnytex.com
> 
> On Tue, April 5, 2005 1:27 pm, Dakota Jack said:
> > Anyone have some code on using JavaScript to open and close popup
> > windows with a Struts Action?  Thanks.
> >
> > Jack
> >
> > --
> > "You can lead a horse to water but you cannot make it float on its back."
> > ~Dakota Jack~
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> > For additional commands, e-mail: user-help@struts.apache.org
> >
> >
> 
> 


-- 
"You can lead a horse to water but you cannot make it float on its back."
~Dakota Jack~

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


Re: Popup Windows with Struts Actions

Posted by "Frank W. Zammetti" <fz...@omnytex.com>.
Not sure what you mean... You mean open the popup from WITHIN an Action?

-- 
Frank W. Zammetti
Founder and Chief Software Architect
Omnytex Technologies
http://www.omnytex.com

On Tue, April 5, 2005 1:27 pm, Dakota Jack said:
> Anyone have some code on using JavaScript to open and close popup
> windows with a Struts Action?  Thanks.
>
> Jack
>
> --
> "You can lead a horse to water but you cannot make it float on its back."
> ~Dakota Jack~
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
>


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


Re: Popup Windows with Struts Actions

Posted by Dakota Jack <da...@gmail.com>.
This looks cool to me as well.  What is with the
target="dontCareThatName"?  Is this necessary, and, if so, what should
"dontCareThatName" be?  Thanks,

On Apr 5, 2005 2:29 PM, jwwoger@chello.at <jw...@chello.at> wrote:
> Dakota Jack wrote:
> 
> >Anyone have some code on using JavaScript to open and close popup
> >windows with a Struts Action?  Thanks.
> >
> >Jack
> >
> >
> >
> I like very much:
> 
> <html:form action="/yourAction" ... target="dontCareThatName"
> onsubmit="window.open('',this.target,'scroolbar=no, toolbar=no');return
> true;">
> <html:text...>
> <html:hidden>
> </html:form>
> 
> The output of yourAction will be shown in the popup, and all your form
> fields are brought the normal way to yourAction
> with no need to put them into a big query string after the url in the
> open() function.
> 
>        Wolfgang
> 
> 


-- 
"You can lead a horse to water but you cannot make it float on its back."
~Dakota Jack~

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


Re: Popup Windows with Struts Actions

Posted by "jwwoger@chello.at" <jw...@chello.at>.
Dakota Jack wrote:

>Anyone have some code on using JavaScript to open and close popup
>windows with a Struts Action?  Thanks.
>
>Jack
>
>  
>
I like very much:

<html:form action="/yourAction" ... target="dontCareThatName" 
onsubmit="window.open('',this.target,'scroolbar=no, toolbar=no');return 
true;">
<html:text...>
<html:hidden>
</html:form>

The output of yourAction will be shown in the popup, and all your form 
fields are brought the normal way to yourAction
with no need to put them into a big query string after the url in the 
open() function.

       Wolfgang