accessing parent window from modal dialog ....

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • dmjpro
    Top Contributor
    • Jan 2007
    • 2476

    accessing parent window from modal dialog ....

    i have a pge .... and i opening a modal dialog box from the page ..

    now my problem is .......

    i want to acces the parent window of the modal dialog box ...
    how can i do it ......

    plz helppppppp me out ....

    lot of thanx in advance ..............
  • acoder
    Recognized Expert MVP
    • Nov 2006
    • 16032

    #2
    Use
    Code:
    var parent = window.dialogArguments;

    Comment

    • dmjpro
      Top Contributor
      • Jan 2007
      • 2476

      #3
      thanx for ur reply ..........

      but this is not my answer what i want .....

      already the code for showModalDialog are written ....

      if i follow ur code then i have to change in lot of places ....

      can't i access using window.opener ......

      again lot of thanx ... in advance

      Comment

      • acoder
        Recognized Expert MVP
        • Nov 2006
        • 16032

        #4
        No, unfortunately, you can't. You can't use window.opener, so you will just have to replace that with window.dialogAr guments.

        If you want something more cross-browser, try this.

        Comment

        • dmjpro
          Top Contributor
          • Jan 2007
          • 2476

          #5
          many many thanx for ur reply ........

          can u explain why this happens ....

          thanx in advance

          Comment

          • acoder
            Recognized Expert MVP
            • Nov 2006
            • 16032

            #6
            I don't know about why this happens. Ask Microsoft why they implemented modal dialogs like that!

            I would just add that do you really need modal dialogs? In most circumstances, there's no need for them.

            Comment

            • dmjpro
              Top Contributor
              • Jan 2007
              • 2476

              #7
              thanx acoder for reply .....

              actually i just asked .... is there any logic behind it ....

              i told u before the code already written ..... and the system is ongoing ....

              any possible solution is very much expected

              Comment

              • balajibirlasoft
                New Member
                • Feb 2008
                • 4

                #8
                Try this.. while opening the modaldialogue send the window as the parameter

                showModalDialog ue(url,window,p arams);
                and in the modal window

                var parWin = window.dialogue Arguments;

                now parWin contains your parent window object

                Comment

                • acoder
                  Recognized Expert MVP
                  • Nov 2006
                  • 16032

                  #9
                  Welcome to TSDN!

                  I think you'll find that you should be using American English spellings rather than British English, i.e. dialog instead of dialogue (though I prefer the latter, being from the UK myself).

                  Comment

                  Working...