Log in

View Full Version : Closing a Dojo dialog



cheechm
04-14-2007, 11:08 PM
Hi,
I have opened a dojo dialog using this code:

<body onload="dlg0.show()" + "dialog0.show()">
When you enter a new page (in an iFrame in the dialog) though I try to close it using this code but it doesn't work:

<body onload="dlg0.hide()">
but nothing happens

Thanks

mburt
04-14-2007, 11:13 PM
You have two conflicting onload event handlers in the first snippet:

<body onload="dlg0.show();dialog0.show()">

cheechm
04-14-2007, 11:16 PM
You have two conflicting onload event handlers in the first snippet:

<body onload="dlg0.show();dialog0.show()">

It didn't seem to matter when I changed them around.
The only thing that isn't working is the close bit.

<body onload="dlg0.hide()"> doesn't actually function when the page is entered. Is it the wrong code?

mburt
04-14-2007, 11:28 PM
If it's inside the iframe, it cannot access the page outside the iframe. You have to use dlg0.hide(); inside the main page.

cheechm
04-14-2007, 11:59 PM
Ok, but if the iFrame is in the Dojo dialog, can you close the Dojo Dialog from inside the iFrame?

mburt
04-15-2007, 11:50 AM
Sorry, you can't. Anything inside the iframe can't access anything outside the iframe.