Close specific parent window

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • CST

    Close specific parent window

    Hi All,

    I looked through numerous posts and couldn't find exactly what I am
    looking for, so I am posting this. We have a web application that
    runs reports. A user needs to run multiple reports at one time. For
    example, a user would run a sales report and an employee report. What
    I would like to do is have a window that basically says "Generating
    report, please wait" for each report that is run. When the report
    finishes processing and is returned to the page, I want to close the
    respective status window for each report run. If I use
    window.opener.c lose(), it will close all of the opener windows. Is it
    possible to say window1.name.cl ose(), windows2.name.c lose()? I hope
    this makes sense.

    TIA
  • Ron

    #2
    Re: Close specific parent window

    "CST" <cont@b-50.com> wrote in message
    news:bd314cc7.0 309230530.59916 89d@posting.goo gle.com...[color=blue]
    > Hi All,
    >
    > I looked through numerous posts and couldn't find exactly what I am
    > looking for, so I am posting this. We have a web application that
    > runs reports. A user needs to run multiple reports at one time. For
    > example, a user would run a sales report and an employee report. What
    > I would like to do is have a window that basically says "Generating
    > report, please wait" for each report that is run. When the report
    > finishes processing and is returned to the page, I want to close the
    > respective status window for each report run. If I use
    > window.opener.c lose(), it will close all of the opener windows. Is it
    > possible to say window1.name.cl ose(), windows2.name.c lose()? I hope
    > this makes sense.
    >
    > TIA[/color]

    Yes you can do just as you suggest.

    Open each window with a given name say matching the report and call it
    explicitly to close it

    var bWin;

    function myWin(){
    Win_ = 'toolbar=no, status=yes, dependent, resizable=yes, scrollbars=yes,
    height=50, width=60'

    if (!bWin) {
    bWin = window.open('', 'secWin',Win_)
    }
    if (bWin.closed) {
    bWin = window.open('', 'secWin',Win_)
    }
    bWin.document.w rite("<br />Processing.. . <br />please wait")
    }

    This function opens a window with a an html target name of secWin
    and an 'internal' javascript name of bWin

    if you perform
    bWin.close();

    in the parent window , the child wil close.

    If you modify the code to pass the name bWin in as a parameter, the myWin
    function can open any number of windows but will do so only once for each
    variable.

    Cheers

    Ron


    Comment

    Working...