Search code examples
javagwtscrolldocklayoutpanel

DockLayoutPanel inside ScrollPanel in GWT


I'm using GWT 2.4 and I'm having a problem with setting up scrollbars for my app working correctly. When I'm trying to zoom the page - no scrollbars are now displayed for the whole page.

Currently my app is composed of DockLayoutPanel and is displayed in the following way:

private DockLayoutPanel appContainer = new DockLayoutPanel(Style.Unit.PX);
(...)
appContainer.addNorth(bannerSimplePanel, 104);
appContainer.addWest(menuSimplePanel, 200);
appContainer.add(new ScrollPanel(contentSimplePanel));

RootLayoutPanel.get().add(appContainer);

I want to have scrollbar configured for whole page instead of only "main content" (contentSimplePanel) of the page. I've tried to add scrollbar to the last step:

RootLayoutPanel.get().add(new ScrollBar(appContainer));

but it didn't work. With ScrollBar added for whole appContainer only banner is displayed on my page and the rest is black.

Thanks for any help.


Solution

  • Adding   DocklayoutPanel to a ScrollPanel won't work. The inner layout
    panel's height and width will be zero. 
    

    Use

    dockLPanel.getWidgetContainerElement(flowPanel).getStyle().setOverflowY(Overflow.AUTO); 
    

    Have a look on this

    https://groups.google.com/forum/?fromgroups=#!topic/google-web-toolkit/BnboxugPuJQ