Welcome Guest Search | Active Topics | Sign In | Register

Close a 'parent' dialog Options
Stefan Jansson
Posted: Monday, March 12, 2012 11:36:48 AM
Rank: Newbie
Groups: Member

Joined: 7/4/2007
Posts: 6
If you have a Dialog which is using ContentUrl to display the content, is it possible to close a dialog from the ContentUrl code?
eo_support
Posted: Monday, March 12, 2012 11:55:05 AM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,194
Hi,

The ContentUrl is hosted inside an iframe. So you can just reference your parent page with "parent" in your JavaScript and then call whatever code in the parent page as if they are directly inside an iframe in your page. I wouldn't recommend you calling dialog.close() directly though. Calling dialog.close() directly from inside the child page is like trying to take down the ladder that you are currently standing on. Strange things happen sometimes when you do that. To avoid problems, you can try to set a timer in the parent page and then call dialog.close() inside the timer handler.

Thanks!
Stefan Jansson
Posted: Tuesday, April 3, 2012 5:39:58 PM
Rank: Newbie
Groups: Member

Joined: 7/4/2007
Posts: 6
I'm able to call the script on the parent page but I have no clue of how to do the timer stuff, do you mind a sample code?

BR Stefan
eo_support
Posted: Tuesday, April 3, 2012 6:47:49 PM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,194
Hi,

You would do something like

Code: JavaScript
window.setTimeout(function()
{
    ....your code here...
}, time_out_value);


Thanks


You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.