PDA

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



Torquester
1 Aug 2009, 1:28 AM
Hi!

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.setHeaderVisible(true);
contentPanel.setHeading("My GXT Content Panel");
HtmlContainer htmlContainer = new HtmlContainer("Hello GXT");
contentPanel.add(htmlContainer);
contentPanel.setLayout(new FitLayout());
layoutContainer.setLayout(new FitLayout());
layoutContainer.add(contentPanel);
layoutContainer.setWidth("100%");
layoutContainer.setHeight("100%");
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

Kalle1985
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...

Torquester
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.