Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
Clear All
new posts

    Center window in client area

    We have a window that has centerInPage() and it does display in the center of the page when shown.

    However, at times when a lot of sections are expanded the page can get much taller than the client area. If the user is scrolled down to the bottom of this long page, the centered window appears above the fold and hidden from view unless the user knows to scroll back up.

    So what we really need is the ability to center the window in the client area (the visible portion of the page within the browser), and not in the center of the page.

    Do you have any way to do that automatically, so we don't have to code all the centering logic?

    #2
    No, there's no automatic way to do this, you'd have to implement your own centering logic.

    Note that the reason there isn't a way to do this automatically is that we don't recommend using browser-level scrolling. It's very buggy and inconsistent.

    Comment


      #3
      Can you elaborate what you meant when you said browser level scrolling is "very buggy and inconsistent"? Every page on the web relies on the browser's scrolling capability - why should a page generated with SmartGWT be any different?

      We have requirements to have blocks on the page that grow as needed based on their content (autoHeight, in SmartGWT terms), and do not scroll internally but display like a normal web page that scrolls. Are you saying this should be avoided with SmartGWT for some reason?

      Comment


        #4
        Browser scrolling is generally fine for simple content, but works somewhat poorly in advanced applications - not just SmartGWT, any advanced web application.

        Among other problems, browser-level scrollbars will sometimes appear when there is not actually any content outside of the viewport (when the browser has a bug that makes it think there still is), and there are timing issues in some browsers where the timing of when content is measured and hence when browser scrollbars appear will cause all dynamic-sized widgets on the page to have to resize twice or more when once should have been possible, because the browser temporarily shows scrollbars that are then hidden.

        SmartGWT's scrolling system avoids all of this.

        Comment

        Working...
        X