[Chameleon] Close popups when main window closes
Bart van den Eijnden
BEN at Syncera-ITSolutions.NL
Tue Dec 13 11:07:21 EST 2005
Okay right, makes sense :-)
So this would only work in a full JSAPI application, or most likely using the AJAX changes Mike Leahy did.
Paul, you once mentioned JSAPI is the way to go for Chameleon in the future. What is your opinion on this now? Are there efforts to integrate Mike's work in the Chameleon core? I might be interested in helping with the actual integration.
Best regards,
Bart
Bart van den Eijnden
Syncera IT Solutions
Postbus 270
2600 AG DELFT
tel.nr.: 015-7512436
email: BEN at Syncera-ITSolutions.nl
>>> Berend Veldkamp <berend.veldkamp at aris.nl> 12/13/2005 4:53:41 PM >>>
Bart,
Thanks for the link.
I just found out my solution might not be very convenient after all:
Popups are also closed after a page refresh, i.e. when zooming in. This
may not be desirable. I think this is going to be a problem for a future
popup manager as well. Unless a separate Close button is added to the
application.
Berend
Bart van den Eijnden wrote:
> Hi Berend,
>
> I think this would be a nice addition.
>
> I can't answer your questions, but I just wanted to point you to a related bug discussion:
>
> http://bugzilla.maptools.org/show_bug.cgi?id=171
>
> Best regards,
> Bart
>
> Bart van den Eijnden
> Syncera IT Solutions
> Postbus 270
> 2600 AG DELFT
>
> tel.nr.: 015-7512436
> email: BEN at Syncera-ITSolutions.nl
>
>
>>>>Berend Veldkamp <berend.veldkamp at aris.nl> 12/13/2005 4:10:04 PM >>>
>
> Hi,
>
> I'd like to close any popup when I close the main application window, so
> I changed CWCPopup->DrawPublish() to include the following Javascript:
>
> var wh = window.open('{$url}', '{$name}', '{$options}');
> if (!wh)
> {
> alert( 'unable to open popup dialog. Perhaps you have a popup
> blocker installed?' );
> }
> else
> {
> if (window.opera) // Opera
> window.opera.addEventListener("BeforeEvent.unload",
> function(){wh.close()}, false);
> else if (window.addEventListener) // W3 DOM
> window.addEventListener("unload", function(){wh.close()}, false);
> else if (window.attachEvent) // IE
> window.attachEvent("onunload", function(){wh.close()});
> wh.focus();
> }
>
> This works for IE and W3 DOM compliant browsers, but not Opera, can
> anyone tell me what I do wrong?
>
> And another thing: With this approach, the Javascript code is duplicated
> for each popup that I use, is it possible to include this only once, as
> a separate function?
>
> If I get this working, would it be possible to include this in the main
> Chameleon distribution, so I don't have to change my own application
> after an upgrade?
>
> Thanks, Berend
>
>
--
____________________________
Berend Veldkamp - ARIS
http://www.aris.nl/
____________________________
_______________________________________________
Chameleon mailing list
Chameleon at lists.maptools.org
http://lists.maptools.org/mailman/listinfo/chameleon
More information about the Chameleon
mailing list