You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by "Gopalakrishnan, Jayesh" <Ja...@schwab.com> on 2004/02/18 21:50:27 UTC

RE: open new window from struts page, leaves [object] in parent w indow

This is more of a javascript issue than Struts thing.

I guess you are missing a "return false;" at the end of the javascript.
Try the script on a simple html page & verify that it works as expected.

I have seen such links use the onclick event rather than the href, like,

<a href="javascript:void(0);"
onClick="javascript:window.open(......)">cccc</a>

possibly to prevent the script from appearing on the status bar....not sure.


hth
-jayash


-----Original Message-----
From: Martin Alley [mailto:martin.alley@ntlworld.com]
Sent: Wednesday, February 18, 2004 12:27 PM
To: struts-user@jakarta.apache.org
Subject: open new window from struts page, leaves [object] in parent
window


Hi,

I guess this has been asked before, but I can't find the answer..

I've got a struts generated page, from which I want to open a new
window.
I do this with the following line, and I get my new window just like I
want
			<a href="javascript:window.open('<%=
request.getContextPath() %>/dataimages/<bean:write name="itemForm"
property="itemValue.imagePath"/>')">
			click here
			</a>
but the original window then contains a page that says [object] -
literally that!!

How do I get the original window not to change from what it displayed
before I click on the above link?

Thanks
Martin




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

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


RE: open new window from struts page, leaves [object] in parent w indow

Posted by Martin Alley <ma...@ntlworld.com>.
Thanks Domingo,  that fixed it!
Martin

-----Original Message-----
From: Domingo A. Rodriguez S. [mailto:domingorodriguez@yahoo.com] 
Sent: 18 February 2004 21:05
To: Struts Users Mailing List
Subject: RE: open new window from struts page, leaves [object] in parent
w indow


Use

  javascript:var handle= window.open(......)

instead of

  javascript:window.open(......)

Regards
Domingo A. Rodriguez S.

 --- "Gopalakrishnan, Jayesh" <Ja...@schwab.com>
escribió:
> This is more of a javascript issue than Struts thing.
> 
> I guess you are missing a "return false;" at the end of the
javascript.
> Try the script on a simple html page & verify that it works as
expected.
> 
> I have seen such links use the onclick event rather than the href,
like,
> 
> <a href="javascript:void(0);"
> onClick="javascript:window.open(......)">cccc</a>
> 
> possibly to prevent the script from appearing on the status bar....not
> sure.
> 
> 
> hth
> -jayash
> 
> 
> -----Original Message-----
> From: Martin Alley [mailto:martin.alley@ntlworld.com]
> Sent: Wednesday, February 18, 2004 12:27 PM
> To: struts-user@jakarta.apache.org
> Subject: open new window from struts page, leaves [object] in parent
> window
> 
> 
> Hi,
> 
> I guess this has been asked before, but I can't find the answer..
> 
> I've got a struts generated page, from which I want to open a new
> window.
> I do this with the following line, and I get my new window just like I
> want
> 			<a href="javascript:window.open('<%=
> request.getContextPath() %>/dataimages/<bean:write name="itemForm"
> property="itemValue.imagePath"/>')">
> 			click here
> 			</a>
> but the original window then contains a page that says [object] -
> literally that!!
> 
> How do I get the original window not to change from what it displayed
> before I click on the above link?
> 
> Thanks
> Martin
> 
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: struts-user-help@jakarta.apache.org
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: struts-user-help@jakarta.apache.org
>  

_________________________________________________________
Do You Yahoo!?
Información de Estados Unidos y América Latina, en Yahoo! Noticias.
Visítanos en http://noticias.espanol.yahoo.com

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



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


RE: open new window from struts page, leaves [object] in parent w indow

Posted by "Domingo A. Rodriguez S." <do...@yahoo.com>.
Use

  javascript:var handle= window.open(......)

instead of

  javascript:window.open(......)

Regards
Domingo A. Rodriguez S.

 --- "Gopalakrishnan, Jayesh" <Ja...@schwab.com> escribió:
> This is more of a javascript issue than Struts thing.
> 
> I guess you are missing a "return false;" at the end of the javascript.
> Try the script on a simple html page & verify that it works as expected.
> 
> I have seen such links use the onclick event rather than the href, like,
> 
> <a href="javascript:void(0);"
> onClick="javascript:window.open(......)">cccc</a>
> 
> possibly to prevent the script from appearing on the status bar....not
> sure.
> 
> 
> hth
> -jayash
> 
> 
> -----Original Message-----
> From: Martin Alley [mailto:martin.alley@ntlworld.com]
> Sent: Wednesday, February 18, 2004 12:27 PM
> To: struts-user@jakarta.apache.org
> Subject: open new window from struts page, leaves [object] in parent
> window
> 
> 
> Hi,
> 
> I guess this has been asked before, but I can't find the answer..
> 
> I've got a struts generated page, from which I want to open a new
> window.
> I do this with the following line, and I get my new window just like I
> want
> 			<a href="javascript:window.open('<%=
> request.getContextPath() %>/dataimages/<bean:write name="itemForm"
> property="itemValue.imagePath"/>')">
> 			click here
> 			</a>
> but the original window then contains a page that says [object] -
> literally that!!
> 
> How do I get the original window not to change from what it displayed
> before I click on the above link?
> 
> Thanks
> Martin
> 
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: struts-user-help@jakarta.apache.org
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: struts-user-help@jakarta.apache.org
>  

_________________________________________________________
Do You Yahoo!?
Información de Estados Unidos y América Latina, en Yahoo! Noticias.
Visítanos en http://noticias.espanol.yahoo.com

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