Search code examples
gwtdocklayoutpanel

GWT DockLayoutPanel oddness


I'm using a DockLayoutPanel for my application. It worked great when I just had widgets in the North, West, and East. When I added one to the South, though, it didn't wind up where I expected - it's more center than south.

    private DockLayoutPanel mainPanel = new DockLayoutPanel(Unit.EM);
    mainPanel.addNorth(topPanel, 15);
    mainPanel.addWest(resultsGrid, 65);
    mainPanel.addEast(wcFlexTable, 35);
    mainPanel.addSouth(pager, 10);


    // Associate the Main panel with the HTML host page. 
    RootLayoutPanel.get().setStylePrimaryName("rootLayoutPanel");
    RootLayoutPanel.get().add(mainPanel);

It is rendered as below - you can see the Pager element, not where I expect it. enter image description here


Solution

  • It turned out that the problem was that I added the South element after East and West. By moving it to before East and West, everything displays as expected.