Reference window.opener after redirecting the popup

Discussion in 'ASP .Net' started by Etienne Charland, Sep 3, 2004.

  1. 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 Charland, Sep 3, 2004
    #1
    1. Advertising

  2. Etienne Charland

    Rutger Smit Guest

    Etienne Charland wrote:

    > 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
    Rutger Smit, Sep 3, 2004
    #2
    1. Advertising

  3. What will it change?

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

    "Rutger Smit" <> wrote in message
    news:...
    > Etienne Charland wrote:
    >
    >> 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
    Etienne Charland, Sep 3, 2004
    #3
  4. Etienne Charland

    Rutger Smit Guest

    Etienne Charland wrote:

    > What will it change?
    >
    > I'm a bit confused, are you talking about adding a frame (or iframe) to the
    > popup?
    >
    > "Rutger Smit" <> wrote in message
    > news:...
    >
    >>Etienne Charland wrote:



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

    >
    >
    >


    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
    Rutger Smit, Sep 3, 2004
    #4
  5. 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" <> wrote in message
    news:...
    > Etienne Charland wrote:
    >
    >> What will it change?
    >>
    >> I'm a bit confused, are you talking about adding a frame (or iframe) to
    >> the popup?
    >>
    >> "Rutger Smit" <> wrote in message
    >> news:...
    >>
    >>>Etienne Charland wrote:

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

    >>
    >>
    >>

    >
    > 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 Charland, Sep 4, 2004
    #5
  6. Etienne Charland

    Rutger Smit Guest

    Etienne Charland wrote:

    > 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" <> wrote in message
    > news:...




    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
    Rutger Smit, Sep 4, 2004
    #6
  7. Etienne Charland

    sdrubow

    Joined:
    Aug 7, 2007
    Messages:
    1
    I found a solution for this problem.

    In my case i needed to put in the main page a value that came from the popup so I used
    top.opener.document.getElementById('codIdent').value = txt.innerHTML;

    Try this!!
    sdrubow, Aug 7, 2007
    #7
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. =?Utf-8?B?Sko=?=
    Replies:
    1
    Views:
    2,206
    =?Utf-8?B?dmluYXk=?=
    Oct 12, 2004
  2. Matt Jensen
    Replies:
    1
    Views:
    5,229
    Matt Jensen
    Dec 16, 2005
  3. Urs Gubler
    Replies:
    0
    Views:
    152
    Urs Gubler
    Jul 2, 2003
  4. sentinel
    Replies:
    1
    Views:
    163
    kaeli
    Feb 16, 2004
  5. window.opener, form.opener?

    , Jul 14, 2006, in forum: Javascript
    Replies:
    5
    Views:
    283
Loading...

Share This Page