Link to home
Start Free TrialLog in
Avatar of Goa_Koala
Goa_Koala

asked on

Getting the parent of the base page that opens a ModelDialog

Hi;

I have this ModalDialog window. The opener page is inside an iframe. What i want to do is i want to reach the parent of the opener page of the dialog. You can reach the opener with window.dialogArguments. But you cannot use parent.window.dialogArguments.
To make things clear here is an example code. If i was using window.open instead of showModalDialog than my code would look like this.

function someFunction()
{
    valueIWantToGet = opener.parent.document.all.tags( "INPUT" )( "someField" ).value;
}

but since i am using a Modal Dialog the code has to be like this.

function someFunction()
{
    windowOpener = window.dialogArguments;
   //Here in the line above we get the opener window.No prob. so far.
 
    valueIWantToGet = windowOpener.parent.document.all.tags( "INPUT" )( "someField" ).value;
    //But when we try to get the parent of the opener window then the problems start
}


So if anybody knows the solution please share it with me. :) Thanks...
Avatar of superm401
superm401

I really don't think that's possible.
Avatar of Goa_Koala

ASKER

No it's possible. I managed :))

when you are opening the modalDialog you open it like this

window.showModalDialog( 'urlOfTheWindow', window, 'parameters' );

you write window( without "" or '' ) in the middle, where you actually write the title of the window. after that

window.dialogArguments.top or window.dialogArguments.parent works just fine. :)
ASKER CERTIFIED SOLUTION
Avatar of modulo
modulo

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial