Andrey Minogin
Andrey Minogin

Reputation: 4615

GWT 100% height panel with scroll

Could anyone help me make normal layout in GWT.

I need a main panel which:

  1. fills all the browser space (100% height);

  2. if being collapsed too much shows scroll bars (autoscroll).

When I use old layout (RootPanel, VerticalPanel) I have scroll, but can't get 100% height.

When I use new layout (RootLayoutPanel, DockLayoutPanel) I get 100% height, but I don't get any scroll. And also I have some troubles in IE.

Is there any sample showing how to achieve both goals?

Thanks in advance!

Upvotes: 4

Views: 6637

Answers (2)

eb1
eb1

Reputation: 2947

I've got this as a RootLayoutPanel with a DockLayoutPanel inside. In the center is a ScrollPanel that takes up the rest of the space and provides the scrolling if needed. My .ui.xml (UIBinder stuff) looks kind of like this:

<g:DockLayoutPanel unit="PX" ui:field="Dock">
            <!-- the g: north, west, east, south guys go here -->
    <g:center>
    <g:ScrollPanel addStyleNames='{style.document_area}'>
    </g:ScrollPanel>
    </g:center>
</g:DockLayoutPanel>

Upvotes: 6

Zwik
Zwik

Reputation: 654

This is what I would try :

  1. Your first panel (except the root) is a ScrollPanel
  2. Your second panel would be your LayoutPanel (or DockLayoutPanel if you prefer).

Upvotes: 0

Related Questions