GWT DockLayoutPanel oddness

65 Views Asked by At

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

2

There are 2 best solutions below

0
On BEST ANSWER

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.

2
On

Considering the units you're using, the south pane seems to me to be correctly positioned, with the pager being at the top of the south pane, the default position for elements within their containers.