You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Kent Tong <ke...@cpttm.org.mo> on 2005/05/01 03:16:57 UTC
Re: close all child browser windows when parent closes
Raymond <pps18033 <at> hotmail.com> writes:
> With ordinary web programming I could do it by some Javascript like this:
> <script language="JavaScript"><!--
> openWins = new Array();
> curWin = 0;
>
> function openWin(page) { openWins[curWin++] = window.open(page,'_blank'); }
>
> function closeAll() {
> for(i=0; i<openWins.length; i++) if (openWins[i] && !openWins[i].closed)
> openWins[i].close();
> }
> //--></script>
Encapsulate the above logic into a component such as ChildWindowsTracker.
Then create a subclass of PopupLinkRenderer and override the constructURL()
method to generate Javascript to register the new window with the script
generated by ChildWindowsTracker.
---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-user-help@jakarta.apache.org