struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ashish Kulkarni <kulkarni_ash1...@yahoo.com>
Subject Re: open new window form struts action..java script variable
Date Wed, 19 Jan 2005 19:27:42 GMT
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
--- fzlists@omnytex.com wrote:

> Geez, 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
> 
> On Wed, January 19, 2005 1:50 pm, PA said:
> > 
> > On Jan 19, 2005, at 19:05, fzlists@omnytex.com
> wrote:
> > 
> >> For my own edification, can you expand on the
> ability to "...define
> >> whatever target you like"?  I've never heard that
> before, I'd be
> >> interested to know more.  I'm wondering
> specifically since the browser
> >> wouldn't know what anything other than the
> defined targets you
> >> referenced meant, how would you go about handling
> them yourself?  Can
> >> you give an example use case?
> > 
> > The target can be named anyway you choose. This is
> handy when you want
> > to create an external window and consistently
> reuse it (e.g. always
> > open external link in "target = 'externalLink'").
> > 
> > Cheers
> > 
> > --
> > PA
> > http://alt.textdrive.com/
> > 
> > 
> >
>
---------------------------------------------------------------------
> > 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



		
__________________________________ 
Do you Yahoo!? 
Read only the mail you want - Yahoo! Mail SpamGuard. 
http://promotions.yahoo.com/new_mail 

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


Mime
View raw message