You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by ryan webb <we...@gmail.com> on 2008/04/16 10:18:29 UTC

Is it possible to make a pop up window using Struts?

Hi,

Is it possible to make a window pop up using struts?
usually this can be done in Javascript..

God bless,
Ryan Webb

Re: Is it possible to make a pop up window using Struts?

Posted by Randy Burgess <RB...@nuvox.com>.
In my example the popup window didn't do any processing because it is a
ForwardAction (org.apache.struts.actions.ForwardAction), the view just got
some values that were either in the session or passed on the query string.
If your form bean is configured properly the values from the query string
should get populated in the form.

Regards,
Randy Burgess
Sr. Web Applications Developer
Nuvox Communications



> From: ryan webb <we...@gmail.com>
> Reply-To: Struts Users Mailing List <us...@struts.apache.org>
> Date: Thu, 17 Apr 2008 09:35:34 +0800
> To: Struts Users Mailing List <us...@struts.apache.org>
> Subject: Re: Is it possible to make a pop up window using Struts?
> 
> Dear Randy,
> 
> Thank you very much for your kind reply..your method is very good. I will
> note your reply. =)
> Is it possible to transfer query string using this method? although i am not
> quite sure yet that this will work.
> 
> I will get parameter in my action class using *
> request.getParameter("orderNumber");* then store it to a form bean
> variable(String data type)then on popup window I will use *<jsp:getProperty>
> * accessing form bean variable (form bean property).
> 
> Again, I would like to thank you for your answer.
> 
> -Ryan Webb
> 
> 
> On Thu, Apr 17, 2008 at 3:56 AM, Randy Burgess <RB...@nuvox.com> wrote:
> 
>> You can pass a query string to the popup window. Here is an example.
>> 
>> <a
>> 
>> href="javascript:popup('printOrder.do?orderNumber=${order.workOrderNumber}',
>> 600, 600, true);">
>> 
>> And then in the popup window to get the orderNumber param passed in above:
>> 
>> <c:if test="${not empty param.orderNumber}">
>> Reference Number: ${param.orderNumber}
>> </c:if>
>> 
>> You might want to change the href to # and put the window.open code in the
>> onclick event but other than that this will work fine. In this case order
>> Is a request attribute for this action.
>> 
>> Regards,
>> Randy Burgess
>> Sr. Web Applications Developer
>> Nuvox Communications
>> 
>> 
>> 
>>> From: ryan webb <we...@gmail.com>
>>> Reply-To: Struts Users Mailing List <us...@struts.apache.org>
>>> Date: Wed, 16 Apr 2008 16:40:25 +0800
>>> To: Struts Users Mailing List <us...@struts.apache.org>
>>> Subject: Re: Is it possible to make a pop up window using Struts?
>>> 
>>> Antonio,
>>> 
>>>> 1) What Struts? Struts 1.2.9 (Netbeans bundle)
>>>> 2) You can still do it in Javascript. I see.. I just want to know if
>> you do
>>> it with struts.
>>> 
>>> I am having trouble with it..I created a pop up window using javascript
>> and
>>> i cant pass query string on new window.
>>> when i clicked a <html:link> I pass a paramId and paramProperty and I
>> cant
>>> make it appear to new window.
>>> 
>>> I have an action class that has *request.setAttribute("username",
>>> request.getParameter("username"));*
>>> on the new window I have *<%=
>> out.println(request.getAttribute("username"))
>>> %>* but this only displays the word NULL
>>> 
>>> I am new to struts..
>>> 
>>> Ryan
>>> 
>>> On Wed, Apr 16, 2008 at 4:22 PM, Antonio Petrelli <
>>> antonio.petrelli@gmail.com> wrote:
>>> 
>>>> 2008/4/16, ryan webb <we...@gmail.com>:
>>>>>  Is it possible to make a window pop up using struts?
>>>>>  usually this can be done in Javascript..
>>>> 
>>>> 1) What Struts?
>>>> 2) You can still do it in Javascript
>>>> 
>>>> Antonio
>>>> 
>>>> ---------------------------------------------------------------------
>>>> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
>>>> For additional commands, e-mail: user-help@struts.apache.org
>>>> 
>>>> 
>> 
>> 
>> 
>> This email and any attachments ("Message") may contain legally privileged
>> and/or confidential information.  If you are not the addressee, or if this
>> Message has been addressed to you in error, you are not authorized to read,
>> copy, or distribute it, and we ask that you please delete it (including all
>> copies) and notify the sender by return email.  Delivery of this Message to
>> any person other than the intended recipient(s) shall not be deemed a waiver
>> of confidentiality and/or a privilege.
>> 
>> 
>> This email and any attachments ("Message") may contain legally privileged
>> and/or confidential information.  If you are not the addressee, or if this
>> Message has been addressed to you in error, you are not authorized to read,
>> copy, or distribute it, and we ask that you please delete it (including all
>> copies) and notify the sender by return email.  Delivery of this Message to
>> any person other than the intended recipient(s) shall not be deemed a waiver
>> of confidentiality and/or a privilege.
>> 



This email and any attachments ("Message") may contain legally privileged and/or confidential information.  If you are not the addressee, or if this Message has been addressed to you in error, you are not authorized to read, copy, or distribute it, and we ask that you please delete it (including all copies) and notify the sender by return email.  Delivery of this Message to any person other than the intended recipient(s) shall not be deemed a waiver of confidentiality and/or a privilege.


This email and any attachments ("Message") may contain legally privileged and/or confidential information.  If you are not the addressee, or if this Message has been addressed to you in error, you are not authorized to read, copy, or distribute it, and we ask that you please delete it (including all copies) and notify the sender by return email.  Delivery of this Message to any person other than the intended recipient(s) shall not be deemed a waiver of confidentiality and/or a privilege.

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


Re: Is it possible to make a pop up window using Struts?

Posted by ryan webb <we...@gmail.com>.
Dear Randy,

Thank you very much for your kind reply..your method is very good. I will
note your reply. =)
Is it possible to transfer query string using this method? although i am not
quite sure yet that this will work.

I will get parameter in my action class using *
request.getParameter("orderNumber");* then store it to a form bean
variable(String data type)then on popup window I will use *<jsp:getProperty>
* accessing form bean variable (form bean property).

Again, I would like to thank you for your answer.

-Ryan Webb


On Thu, Apr 17, 2008 at 3:56 AM, Randy Burgess <RB...@nuvox.com> wrote:

> You can pass a query string to the popup window. Here is an example.
>
> <a
>
> href="javascript:popup('printOrder.do?orderNumber=${order.workOrderNumber}',
> 600, 600, true);">
>
> And then in the popup window to get the orderNumber param passed in above:
>
> <c:if test="${not empty param.orderNumber}">
> Reference Number: ${param.orderNumber}
> </c:if>
>
> You might want to change the href to # and put the window.open code in the
> onclick event but other than that this will work fine. In this case order
> Is a request attribute for this action.
>
> Regards,
> Randy Burgess
> Sr. Web Applications Developer
> Nuvox Communications
>
>
>
> > From: ryan webb <we...@gmail.com>
> > Reply-To: Struts Users Mailing List <us...@struts.apache.org>
> > Date: Wed, 16 Apr 2008 16:40:25 +0800
> > To: Struts Users Mailing List <us...@struts.apache.org>
> > Subject: Re: Is it possible to make a pop up window using Struts?
> >
> > Antonio,
> >
> >> 1) What Struts? Struts 1.2.9 (Netbeans bundle)
> >> 2) You can still do it in Javascript. I see.. I just want to know if
> you do
> > it with struts.
> >
> > I am having trouble with it..I created a pop up window using javascript
> and
> > i cant pass query string on new window.
> > when i clicked a <html:link> I pass a paramId and paramProperty and I
> cant
> > make it appear to new window.
> >
> > I have an action class that has *request.setAttribute("username",
> > request.getParameter("username"));*
> > on the new window I have *<%=
> out.println(request.getAttribute("username"))
> > %>* but this only displays the word NULL
> >
> > I am new to struts..
> >
> > Ryan
> >
> > On Wed, Apr 16, 2008 at 4:22 PM, Antonio Petrelli <
> > antonio.petrelli@gmail.com> wrote:
> >
> >> 2008/4/16, ryan webb <we...@gmail.com>:
> >>>  Is it possible to make a window pop up using struts?
> >>>  usually this can be done in Javascript..
> >>
> >> 1) What Struts?
> >> 2) You can still do it in Javascript
> >>
> >> Antonio
> >>
> >> ---------------------------------------------------------------------
> >> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> >> For additional commands, e-mail: user-help@struts.apache.org
> >>
> >>
>
>
>
> This email and any attachments ("Message") may contain legally privileged
> and/or confidential information.  If you are not the addressee, or if this
> Message has been addressed to you in error, you are not authorized to read,
> copy, or distribute it, and we ask that you please delete it (including all
> copies) and notify the sender by return email.  Delivery of this Message to
> any person other than the intended recipient(s) shall not be deemed a waiver
> of confidentiality and/or a privilege.
>
>
> This email and any attachments ("Message") may contain legally privileged
> and/or confidential information.  If you are not the addressee, or if this
> Message has been addressed to you in error, you are not authorized to read,
> copy, or distribute it, and we ask that you please delete it (including all
> copies) and notify the sender by return email.  Delivery of this Message to
> any person other than the intended recipient(s) shall not be deemed a waiver
> of confidentiality and/or a privilege.
>

Re: Is it possible to make a pop up window using Struts?

Posted by Antonio Petrelli <an...@gmail.com>.
2008/4/16, ryan webb <we...@gmail.com>:
>
> I am having trouble with it..I created a pop up window using javascript
> and
> i cant pass query string on new window.
> when i clicked a <html:link> I pass a paramId and paramProperty and I cant
> make it appear to new window.
>
> I have an action class that has *request.setAttribute("username",
> request.getParameter("username"));*
> on the new window I have *<%=
> out.println(request.getAttribute("username"))
> %>* but this only displays the word NULL



Mmmm.... I think that you need to start from a tutorial, won't you?
http://struts.apache.org/1.x/userGuide/index.html

With Struts 1 you don't need to read parameters, but use the corresponding
ActionForm.
Moreover you need to understand the lifecycle of a request: when a new
request is created (for example, when a popup page is shown) the request
attributes are cleared.

Antonio

Re: Is it possible to make a pop up window using Struts?

Posted by Randy Burgess <RB...@nuvox.com>.
You can pass a query string to the popup window. Here is an example.

<a 
href="javascript:popup('printOrder.do?orderNumber=${order.workOrderNumber}',
600, 600, true);">

And then in the popup window to get the orderNumber param passed in above:

<c:if test="${not empty param.orderNumber}">
Reference Number: ${param.orderNumber}
</c:if>

You might want to change the href to # and put the window.open code in the
onclick event but other than that this will work fine. In this case order
Is a request attribute for this action.
 
Regards,
Randy Burgess
Sr. Web Applications Developer
Nuvox Communications



> From: ryan webb <we...@gmail.com>
> Reply-To: Struts Users Mailing List <us...@struts.apache.org>
> Date: Wed, 16 Apr 2008 16:40:25 +0800
> To: Struts Users Mailing List <us...@struts.apache.org>
> Subject: Re: Is it possible to make a pop up window using Struts?
> 
> Antonio,
> 
>> 1) What Struts? Struts 1.2.9 (Netbeans bundle)
>> 2) You can still do it in Javascript. I see.. I just want to know if you do
> it with struts.
> 
> I am having trouble with it..I created a pop up window using javascript and
> i cant pass query string on new window.
> when i clicked a <html:link> I pass a paramId and paramProperty and I cant
> make it appear to new window.
> 
> I have an action class that has *request.setAttribute("username",
> request.getParameter("username"));*
> on the new window I have *<%= out.println(request.getAttribute("username"))
> %>* but this only displays the word NULL
> 
> I am new to struts..
> 
> Ryan
> 
> On Wed, Apr 16, 2008 at 4:22 PM, Antonio Petrelli <
> antonio.petrelli@gmail.com> wrote:
> 
>> 2008/4/16, ryan webb <we...@gmail.com>:
>>>  Is it possible to make a window pop up using struts?
>>>  usually this can be done in Javascript..
>> 
>> 1) What Struts?
>> 2) You can still do it in Javascript
>> 
>> Antonio
>> 
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
>> For additional commands, e-mail: user-help@struts.apache.org
>> 
>> 



This email and any attachments ("Message") may contain legally privileged and/or confidential information.  If you are not the addressee, or if this Message has been addressed to you in error, you are not authorized to read, copy, or distribute it, and we ask that you please delete it (including all copies) and notify the sender by return email.  Delivery of this Message to any person other than the intended recipient(s) shall not be deemed a waiver of confidentiality and/or a privilege.


This email and any attachments ("Message") may contain legally privileged and/or confidential information.  If you are not the addressee, or if this Message has been addressed to you in error, you are not authorized to read, copy, or distribute it, and we ask that you please delete it (including all copies) and notify the sender by return email.  Delivery of this Message to any person other than the intended recipient(s) shall not be deemed a waiver of confidentiality and/or a privilege.

Re: Is it possible to make a pop up window using Struts?

Posted by ryan webb <we...@gmail.com>.
Antonio,

>1) What Struts? Struts 1.2.9 (Netbeans bundle)
>2) You can still do it in Javascript. I see.. I just want to know if you do
it with struts.

I am having trouble with it..I created a pop up window using javascript and
i cant pass query string on new window.
when i clicked a <html:link> I pass a paramId and paramProperty and I cant
make it appear to new window.

I have an action class that has *request.setAttribute("username",
request.getParameter("username"));*
on the new window I have *<%= out.println(request.getAttribute("username"))
%>* but this only displays the word NULL

I am new to struts..

Ryan

On Wed, Apr 16, 2008 at 4:22 PM, Antonio Petrelli <
antonio.petrelli@gmail.com> wrote:

> 2008/4/16, ryan webb <we...@gmail.com>:
> >  Is it possible to make a window pop up using struts?
> >  usually this can be done in Javascript..
>
> 1) What Struts?
> 2) You can still do it in Javascript
>
> Antonio
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
>

Re: Is it possible to make a pop up window using Struts?

Posted by Antonio Petrelli <an...@gmail.com>.
2008/4/16, ryan webb <we...@gmail.com>:
>  Is it possible to make a window pop up using struts?
>  usually this can be done in Javascript..

1) What Struts?
2) You can still do it in Javascript

Antonio

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