Advanced Search

Results 1 to 6 of 6

Thread: Closing a Dojo dialog

  1. #1
    Join Date
    Apr 2007
    Posts
    11
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Closing a Dojo dialog

    Hi,
    I have opened a dojo dialog using this code:
    Code:
    <body onload="dlg0.show()" + "dialog0.show()">
    When you enter a new page (in an iFrame in the dialog) though I try to close it using this code but it doesn't work:
    Code:
    <body onload="dlg0.hide()">
    but nothing happens

    Thanks

  2. #2
    Join Date
    Jul 2006
    Location
    Canada
    Posts
    2,581
    Thanks
    13
    Thanked 28 Times in 28 Posts

    Default

    You have two conflicting onload event handlers in the first snippet:
    Code:
    <body onload="dlg0.show();dialog0.show()">
    - Mike

  3. #3
    Join Date
    Apr 2007
    Posts
    11
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Quote Originally Posted by mburt View Post
    You have two conflicting onload event handlers in the first snippet:
    Code:
    <body onload="dlg0.show();dialog0.show()">
    It didn't seem to matter when I changed them around.
    The only thing that isn't working is the close bit.
    Code:
    <body onload="dlg0.hide()">
    doesn't actually function when the page is entered. Is it the wrong code?

  4. #4
    Join Date
    Jul 2006
    Location
    Canada
    Posts
    2,581
    Thanks
    13
    Thanked 28 Times in 28 Posts

    Default

    If it's inside the iframe, it cannot access the page outside the iframe. You have to use dlg0.hide(); inside the main page.
    - Mike

  5. #5
    Join Date
    Apr 2007
    Posts
    11
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Ok, but if the iFrame is in the Dojo dialog, can you close the Dojo Dialog from inside the iFrame?

  6. #6
    Join Date
    Jul 2006
    Location
    Canada
    Posts
    2,581
    Thanks
    13
    Thanked 28 Times in 28 Posts

    Default

    Sorry, you can't. Anything inside the iframe can't access anything outside the iframe.
    - Mike

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •