5 Replies Latest reply on Apr 15, 2008 11:51 AM by nbelaevski

    Modal panel opens in wrong position in IE

    modoc

      I have a richfaces modal panel in my application. I am using 3.2.0, with Seam, on JBoss 4.2.2.

      In Safari, Firefox, Camino, etc.. the modal panel opens in the middle of the browser window.

      In both IE6 and IE7 it opens far to the right, often starting off half off the screen.

      My modal panel tag:

      <rich:modalPanel id="pictureModal" autosized="true" zindex="2000">

      I launch it using an a:commandLink:

      oncomplete="Richfaces.showModalPanel('pictureModal',{width:760, top:20});"



      Any ideas?

      Thanks!

        • 1. Re: Modal panel opens in wrong position in IE
          oneilltg

          FWIW, we also have this issue. We don't see it happening in FireFox. It happens regularly with IE, though it usually is too far down in addition to being too far to the right.

          • 2. Re: Modal panel opens in wrong position in IE
            oneilltg

             

            "oneilltg" wrote:
            FWIW, we also have this issue. We don't see it happening in FireFox. It happens regularly with IE, though it usually is too far down in addition to being too far to the right.


            I should add that we use RichFaces 3.1.4

            • 3. Re: Modal panel opens in wrong position in IE
              modoc

              I actually discovered, to my embarrassment, that I was still on 3.1.4 when I posted this. I had upgraded one of my projects to 3.2.0, but not this one.

              Try adding a width attribute to the modal tag. For me that fixed it. I think what IE was doing was starting centered with the minimum width needed for fixed elements, and then when I rerendered with a large object (image in my case) in the modal, it expanded to the right and down, instead of expanding equally left and right, like other browsers.

              By adding a fixed width, it seems to work for me now.

              • 4. Re: Modal panel opens in wrong position in IE
                oneilltg

                That didn't seem to change anything for me. I went ahead and added a top and left tag to the rich:modalPanel, and now I have it opening in the top left of the window. Better than off the screen, though not as good as centered.

                <rich:modalPanel id="xxxxxx" minHeight="670" minWidth="410"
                height="700" width="410" top="10" left="10" >

                • 5. Re: Modal panel opens in wrong position in IE
                  nbelaevski

                  Hello,

                  There are some bugs in the code causing autosized modal panel to fail with centering. I've created a JIRA issue for that: http://jira.jboss.com/jira/browse/RF-3078