You are setting 100% height of the VerticalPanel
in the middle of the DockLayout
, but you are not setting also the middle cell height to 100%. Try with:
dockPanel.setCellHeight(mainPanel, "100%");
Anyway using tables and percentages can lead to subtle problems that often you need to handle on your own. Always ask yourself "100% of what?".
Also, quoting the javadoc from DockPanel
:
This widget has limitations in standards mode that did not exist in quirks mode. The child Widgets contained within a DockPanel cannot be sized using percentages. Setting a child widget's height to 100% will NOT cause the child to fill the available height.
If you need to work around these limitations, use DockLayoutPanel instead, but understand that it is not a drop in replacement for this class. It requires standards mode, and is most easily used under a RootLayoutPanel (as opposed to a RootPanel).
Using <!DOCTYPE html>
sets the page in standard mode, meaning this will not going to work properly, and in quirks mode you have to experiment on your own.
Try also to consider using a Layout
-based approach, as suggested by the javadoc. Since you are using a single div for the whole page (that rootContainer
), it should be painless to use. See https://developers.google.com/web-toolkit/doc/latest/DevGuideUiPanels#LayoutPanels.