views:

1583

answers:

4

I have a page that opens a modal dialog. After the operations done on dialog I want to refresh the opener page. But when I open the popup by using "openDialog" I cannot access to the opener by using window.opener on popup page. It appears "undefined" when I wanted to access. (I dont want to use "popup" method in this case. I want it to be a dialog by the way. using "popup" is my second plan.)

What is the best practice to get rid off this issue?

A: 

When i use Shadowbox i can access this.

self.parent.location.reload();

Perhaps this works for you also.

Ólafur Waage
A: 

if you look at https://developer.mozilla.org/En/DOM/Window.openDialog you'll see that you can make the dialog box modal by passing the modal argument through, that way it wont return until the dialog is finished, at that time you can reload parent page.

John Boker
+2  A: 

Modifying parent data from modal dialog

Refresh parent window from modal child window

rahul
thanks for the link "Modifying parent data from modal dialog"
Ozan BAYRAM
A: 

this was what i need that i got from the link

In the parent:

parentVar = "set by parent";
vRv = window.showModalDialog("modalWindow.html",window.self, "");

In the modal:

dialogArguments.parentVar = "set by modal";

PS: Dont forget to set reference to opener with "window.self"

Ozan BAYRAM