Wicket
  1. Wicket
  2. WICKET-2059

ModalWindow vertical position in iframes is incorrect

    Details

    • Type: Bug Bug
    • Status: Reopened
    • Priority: Major Major
    • Resolution: Unresolved
    • Affects Version/s: 1.3.5, 1.4-M1, 1.4-M2, 1.4-M3, 1.4-RC1
    • Fix Version/s: None
    • Component/s: wicket-extensions
    • Labels:
      None

      Description

      In a normal page, the ModalWindow center method in modal.js centres the window in the exact centre of the viewable screen, horizontally and vertically.

      However, in an iframe, the viewport calculation is not correct and if the iframe is long, the ModalWindow can be positioned off screen. Adjustment to the vertical centre calculations needs to be done to make it work with iframes.

      1. modalwindowbug.zip
        6.17 MB
        Sander Plas

        Activity

        Hide
        Sander Plas added a comment -

        This quickstart demonstrates that this problem still exists in Wicket 1.4.17. Just click the link and you'll see that the modal window opens outside the visible part of the iframe. Tested in Firefox, Opera and Chromium on Linux on a 1680x1050 screen.

        Show
        Sander Plas added a comment - This quickstart demonstrates that this problem still exists in Wicket 1.4.17. Just click the link and you'll see that the modal window opens outside the visible part of the iframe. Tested in Firefox, Opera and Chromium on Linux on a 1680x1050 screen.
        Hide
        Igor Vaynberg added a comment -

        please reopen with a quickstart if still happening in latest 1.4.x

        Show
        Igor Vaynberg added a comment - please reopen with a quickstart if still happening in latest 1.4.x
        Hide
        Johan Compagner added a comment -

        yes this is also something we in our company already came across
        its on my todo to look at it sometime, Do you have a patch ?

        Show
        Johan Compagner added a comment - yes this is also something we in our company already came across its on my todo to look at it sometime, Do you have a patch ?
        Hide
        Jason Rosenberg added a comment -

        Also, it might be desirable to allow it to default to centered, as is currently the case, unless centering would place the top of the modal window out of view. In that case, the position should be set to guarantee the top of the window in view. This would be a reasonable default behavior, without the need to add a method to the api...

        Jason

        Show
        Jason Rosenberg added a comment - Also, it might be desirable to allow it to default to centered, as is currently the case, unless centering would place the top of the modal window out of view. In that case, the position should be set to guarantee the top of the window in view. This would be a reasonable default behavior, without the need to add a method to the api... Jason
        Hide
        Jason Rosenberg added a comment -

        This problem is limited only to iframes. If you have a browser window that is not very large vertically, the ModalWindow will popup with the title bar above the top of the window, and it's not possible to close the window without closing the browser. Even if you resize the browser, the top of the window does not appear.

        A simple addition to the ModalWindow class would be to add a method like
        setInitialPosition(int x,int y);

        Jason

        Show
        Jason Rosenberg added a comment - This problem is limited only to iframes. If you have a browser window that is not very large vertically, the ModalWindow will popup with the title bar above the top of the window, and it's not possible to close the window without closing the browser. Even if you resize the browser, the top of the window does not appear. A simple addition to the ModalWindow class would be to add a method like setInitialPosition(int x,int y); Jason
        Hide
        Daniel Teske added a comment -

        here you can see that the initial vertical position of the ModalWindow is to high. it is not possible to close the ModalWindow, so everyone must close the whole browserwindow.

        Show
        Daniel Teske added a comment - here you can see that the initial vertical position of the ModalWindow is to high. it is not possible to close the ModalWindow, so everyone must close the whole browserwindow.

          People

          • Assignee:
            Johan Compagner
            Reporter:
            Steve Swinsburg
          • Votes:
            3 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

            • Created:
              Updated:

              Development