0
votes

I want to have a two widgets to stack up

X

Y

I want Y to take up as much height as it needs (its static in size, roughly 50px depending on browser font, etc) and remain affixed to the bottom of the screen, and X to take the rest of the vertical space.

X happens to be a scrollpanel with VerticalPanel and more inside, Y is a Grid and I've tried putting them in various containers, but they all seem to want a size for Y (ie. DockLayoutPanel & LayoutPanel). If I specify a size for Y it ends up with white space at the bottom on one browser or another. Any advice?

1

1 Answers

0
votes

It's just not possible in HTML/CSS. If you absolutely cannot know the height of Y in advance, the way around it would be to:

  • Attach this widget somewhere off-screen
  • Measure it's height using yWidget.getOffsetHeight()
  • Remove it
  • Add it to your LayoutPanel and setting the 'bottom' coordinate to 0 and 'height' to the measured height.