Tuesday 19 July 2011

GWT: When the browser's scrollbars don't show...

... try adding the overflow:auto css property to your root view. For example,

(1) Define the .overflowAuto style in your styles.css file, as follows:
.overflowAuto { overflow:auto; }

(2) Declare it in your Styles.java file, as follows:
public String overflowAuto();

(3) Add it to your outermost HTMLPanel's styles in RootView.ui.xml, as follows:
<g:HTMLPanel addStyleNames="{res.styles.overflowAuto}">

That should work. The problem seems to arise when using LayoutPanels (and similar panels?) but haven't investigated it thoroughly so just an inkling.

No comments: