though not a struts issue, the anchor tags target attribute is generally
used when dealing with frames. I have READ that forcing content into a new
window can cause problems for user agents (html readers).
-----Original Message-----
From: David G. Friedman [mailto:***@ix.netcom.com]
Sent: Wednesday, January 19, 2005 2:48 PM
To: Struts Users Mailing List
Subject: RE: open new window form struts action..java script variable
Why not set the window name to something specific such as mysite_com_popup
and then use that name as a target in the future?
Regards,
David
-----Original Message-----
From: Ashish Kulkarni [mailto:***@yahoo.com]
Sent: Wednesday, January 19, 2005 2:28 PM
To: Struts Users Mailing List
Subject: Re: open new window form struts action..java script variable
Hi
thanx guys for the clarification, here is a very
intresting problem with defining target and opening
new window,
suppose you open a new window using java script in
mypage.jsp
your code will be like below in mypage.jsp
var TheNewWin;
if(!TheNewWin || TheNewWin.closed)
{
TheNewWin = window.open('abc.jsp');
}
else
{
TheNewWin.focus();
}
for some reason you browse to mypage2.jsp and then
come back to mypage.jsp
and call this java script, it will open a new window
(remmemer we have not closed the previous window)
because variable TheNewWin is defined again, and as no knowledge of the
already open window, how will you handle this situation Ashish
Post by f***@omnytex.comGeez, I wish I'd have known that before! So are you
saying that if the browser doesn't recognize the
target as one of the predefined types, it will
assume it should open a new window named according
to the target value? That's cool, and I didn't know
it. It would have saved me some trouble a few weeks
back because I had to add some code to a system to
deal with a situation where a popup window might
have been opened and things broke if a certain
request was submitted again with it still open. I
just added a quick Javascript check and closed the
window if it was open before submitting the form,
but this would have been much better!
--
Frank W. Zammetti
Founder and Chief Software Architect
Omnytex Technologies
http://www.omnytex.com
Post by PAPost by f***@omnytex.comFor my own edification, can you expand on the
ability to "...define
Post by PAPost by f***@omnytex.comwhatever target you like"? I've never heard that
before, I'd be
Post by PAPost by f***@omnytex.cominterested to know more. I'm wondering
specifically since the browser
Post by PAPost by f***@omnytex.comwouldn't know what anything other than the
defined targets you
Post by PAPost by f***@omnytex.comreferenced meant, how would you go about handling
them yourself? Can
Post by PAPost by f***@omnytex.comyou give an example use case?
The target can be named anyway you choose. This is
handy when you want
Post by PAto create an external window and consistently
reuse it (e.g. always
Post by PAopen external link in "target = 'externalLink'").
Cheers
--
PA
http://alt.textdrive.com/
---------------------------------------------------------------------
---------------------------------------------------------------------
user-***@struts.apache.org
__________________________________
Do you Yahoo!?
Read only the mail you want - Yahoo! Mail SpamGuard.
http://promotions.yahoo.com/new_mail
---------------------------------------------------------------------
To unsubscribe, e-mail: user-***@struts.apache.org
For additional commands, e-mail: user-***@struts.apache.org