Login Register

How to publish subscribe across windows when child is modal

Hi,

I am using dojo publish and subscribe across windows. I used the following post to get things working:

http://dojotoolkit.org/forum/dojo-core-dojo-0-9/dojo-core-support/dojo-p...

Solution provided in this post works perfectly fine if the child is opened using window.open. I want a modal child window and am using window.showModalDialog for that. In this case I am not able to publish anything from child to parent. The instance of window.opener in child is undefined. I also tried using window.dialogArguments and window.parent to publish events but nothing works. Can someone please let me know how to get this working.

Thanks.

if you can't get out of the

if you can't get out of the JS sandbox at all to talk to the parent window, I don't know that there's much recourse. I'm not really familiar with the showModalDialog system (i always just use a dijit.Dialog), but ISTM that if window.parent won't get you where you want to be then you might be hosed.

Regards

--
Project Lead, The Dojo Toolkit
President, The Dojo Foundation

It seems that

It seems that window.opener.dojo.publish works fine but window.parent.dojo.publish does not work. I am not getting any JS error but the subscribed method is not getting called.