3

Is it possible to add DockLayoutPanel inside another panel other than the RootLayoutPanel? If so, how would you do it? I attempted to add it inside HTMLPanel, and only north of the DockLayoutPanel shows. Then I tried it inside LayoutPanel, it failed again.

I thought it would have work for LayoutPanel because RootLayoutPanel is a subclass of LayoutPanel.

Any answers welcome. Thanks,

Wen
  • 73
  • 2
  • 7
  • is it giving you an error, or is just nothing shouwin up on the screen? – Stefan Jan 08 '12 at 18:14
  • Hi Stefan, there was no error, but only the north panel is displaying. Thanks to Thomas Broyer, I figure it out now. It was because HTMLPanel does not implement ProvidesResize and I did not explicitly set the size of the DockLayoutPanel, so it was only displaying the north panel. – Wen Jan 22 '12 at 03:56

1 Answers1

3

DockLayoutPanel is a RequiresResize widget, so either you put it inside a ProvidesResize widget (any so called layout panel) or you give it an explicit size.

See the Using a LayoutPanel without RootLayoutPanel section in http://code.google.com/webtoolkit/doc/latest/DevGuideUiPanels.html#Recipes

Thomas Broyer
  • 64,353
  • 7
  • 91
  • 164
  • I have a layout with DockLayoutPanel where center has HTMLPanel as a container for contents. The content however is also a DockLayoutPanel defined in UiBinder of another view class. How do I add that programmatically? I can add other contents just fine, but for DockLayoutPanel, only the north panel is displaying. – Wen Jan 16 '12 at 06:58
  • HTMLPanel cannot ProvidesResize for the inner DockLayoutPanel, so you have to explicitly set the size of that panel. – Thomas Broyer Jan 16 '12 at 20:14