Reference window.opener after redirecting the popup

  • Thread starter Thread starter Etienne Charland
  • Start date Start date
E

Etienne Charland

Hi, I have a simple problem that doesn't seem to have an easy solution. I
have a popup used in many places in the application. At the top of the page,
there is a link to switch between two views of the data. And in both views,
I need a reference to the opener window. The problem is... once I change
view, window.opener loose it's reference. How can I work-around that?

Since that popup is an utility used in many places, I must not have to
modify all the pages using it.

Thanks for your help!
Etienne
 
Etienne said:
Hi, I have a simple problem that doesn't seem to have an easy solution. I
have a popup used in many places in the application. At the top of the page,
there is a link to switch between two views of the data. And in both views,
I need a reference to the opener window. The problem is... once I change
view, window.opener loose it's reference. How can I work-around that?

Since that popup is an utility used in many places, I must not have to
modify all the pages using it.

Thanks for your help!
Etienne

Launch it from a 'hidden' frame (frameset of two frames with a width set
to * and 100%).



//Rutger
 
What will it change?

I'm a bit confused, are you talking about adding a frame (or iframe) to the
popup?
 
Etienne said:
What will it change?

I'm a bit confused, are you talking about adding a frame (or iframe) to the
popup?

You have to make a master frameset with a 100% height frame where all
your stuff wil happen (like the window with the pages right now).

The popup opens from the other frame. Now you can communicate from the
100% frame to the hidden frame and from the hidden frame you can
communicate with the popup.
Maybe you can even access the popup straight away with
parent.window["HiddenFrameName"].WindowOpener

WindowOpener is defined in the hidden frame JavaScript like
WindowOpener=window.open("MyPopup.aspx","bla","width=200, height="200");

I do not guarantee that you the above code is the working way, it meant
to be a idea which direction to search for a solution.

//Rutger
 
Oh. There's a detail I haven't explained clearly. It is the popup who switch
to another page, not the parent window. And it is the popup who needs to
access the parent.

Rutger Smit said:
Etienne said:
What will it change?

I'm a bit confused, are you talking about adding a frame (or iframe) to
the popup?

You have to make a master frameset with a 100% height frame where all your
stuff wil happen (like the window with the pages right now).

The popup opens from the other frame. Now you can communicate from the
100% frame to the hidden frame and from the hidden frame you can
communicate with the popup.
Maybe you can even access the popup straight away with
parent.window["HiddenFrameName"].WindowOpener

WindowOpener is defined in the hidden frame JavaScript like
WindowOpener=window.open("MyPopup.aspx","bla","width=200, height="200");

I do not guarantee that you the above code is the working way, it meant to
be a idea which direction to search for a solution.

//Rutger
 
Etienne said:
Oh. There's a detail I haven't explained clearly. It is the popup who switch
to another page, not the parent window. And it is the popup who needs to
access the parent.

news:[email protected]...



Still use the hidden vframe but in this case you can use it as a buffer.
Open the popup whenever you want, do the things with the pop you want,
store the values that you need later on in the hidden frame (using input
fields pr something like that).

Now you can close the popup, navigate in the main frame and when needed,
access the values in the hidden frame with JavaScript.

Question: why not use the Session object?

//Rutger
 
Back
Top