4

I am working with GWT 2.1.1, every time I use RootLayoutPanel instead of RootPanel in my EntryPoint class, the scroll bars for the browser gets completely disabled, so when my content doesn't fit on the screen there is no way to get to it.

How do I use the new Layout based Panel classes that require RootLayoutPanel and still get my auto-appearing and disappearing scroll bars at the Browser level.

I am NOT talking about putting stuff in a ScrollPanel I want the browser scroll bar behavior that RootPanel provides, but with a RootLayoutPanel.

How do you get a TabLayoutPanel to autofill the page and have the browser automatically produce scroll bars for the entire page?

I tried putting overflow: auto; on my RootLayoutPanel as suggested below, has no affect.

1 Answers1

5

This is by-design. Layout panels do not resize based on their content, they resize their content based on their own size. So, depending on what you want, either you shouldn't use layout panels, or you'd have to make panels scrollables (you can just use the overflow CSS property, you're not forced to use a ScrollPanel)

Thomas Broyer
  • 64,353
  • 7
  • 91
  • 164
  • So how to you use the `TabLayoutPanel` and get the scroll bars on the Browser window? –  Mar 14 '11 at 04:34
  • `overflow: auto` doesn't seem to do anything, I applied it to my `RootLayoutPanel` same behavior. –  Mar 14 '11 at 04:44
  • Don't use RootLayoutPanel then. This means you'll have to give an explicit size to your TabLayoutPanel, which you can, for instance, compute based on the size of the window and the size of the tab's content (using which height is the greatest). Layout panels are not meant to adapt their size to their content, but the other way around. If that's not what you want, it's probably best not to use them (i.e. use TabPanel rather than TabLayoutPanel) – Thomas Broyer Mar 21 '11 at 23:02