View Full Version : Layout problem - can't set height/width to 100%

1 Aug 2009, 1:28 AM

I have a GWT DockPanel and want to place a GXT ContentPanel inside. I want the ContentPanel to take up all the available space. I tried around a lot using FitLayout, RowLayout with RowData(1,1) and of course a lot of calls to setHeight("100%") / setWidth("100%") but the ContentPanel most times has a size of 100 x 100 pixels.

Code Snippet:

ContentPanel contentPanel = new ContentPanel();
contentPanel.setHeading("My GXT Content Panel");
HtmlContainer htmlContainer = new HtmlContainer("Hello GXT");
contentPanel.setLayout(new FitLayout());
layoutContainer.setLayout(new FitLayout());
myGwtDockPanel.add(layoutContainer, DockPanel.CENTER);

Is the problem maybe that I'm trying to host GXT Widgets directly within a GWT Widget? Do I necessarily have to use ViewPort (I actually don't want to change my GWT site structure)? I would be happy for any suggestions!

Thanks, Christian

3 Aug 2009, 12:07 AM
Hello Torquester,

maybe it will work with the .setAutoHeight(true) / .setAutoWidth(true) -methods
of the myGwtDockPanel...

I have tryed to set the same setting with .setHeight("100%") in my app. but
i think thats not possible...

3 Aug 2009, 2:13 AM
Thanks for your response. Unfortunately the Gwt DockPanel does not have a setAutoWidth / setAutoHeight method, since those are declared in the BoxComponent class.