-
13 Feb 2012 7:44 AM #1
Windows and Layouts
Windows and Layouts
Trying to migrate an "old" GXT 2.2.5 application to the brand new gxt 3.0 I have encountered this problem.
In my old application I have used many Window Forms with AbsoluteLayout for setting up their Labels and Fields in fixed positions.
Since I have read in the Darrell Meyer Blog "Ext GWT 3.0 Developer Preview 2" that "... the layouts are now built into the container - it’s no longer required to set a layout manually ..." so I have tried to position (and resize) my objects directly into the Window.
In the following sample I cannot resize the TextField to the values I want;
maybe any default layout still working ?Code:package test.client; import com.google.gwt.core.client.EntryPoint; import com.sencha.gxt.widget.core.client.Window; import com.sencha.gxt.widget.core.client.form.TextField; public class Main implements EntryPoint { public void onModuleLoad() { Window win = new Window(); win.setPixelSize(800, 600); TextField tf = new TextField(); tf.setPixelSize(100, 22); win.add(tf); tf.setPosition(10, 10); win.show(); } }
Can someone tell me what is wrong in my code ?
Every help will be appreciated.
-
16 Feb 2012 3:54 AM #2
Solution ?
Solution ?
I've found a simple workaround, here is the code:
Anyone can tell me if I'm heading to the right direction ?Code:package test.client; import com.google.gwt.core.client.EntryPoint; import com.google.gwt.user.client.ui.AbsolutePanel; import com.sencha.gxt.widget.core.client.Window; import com.sencha.gxt.widget.core.client.form.TextField; public class Main implements EntryPoint { public void onModuleLoad() { Window win = new Window(); win.setPixelSize(800, 600); TextField tf = new TextField(); tf.setPixelSize(100, 22); AbsolutePanel panel = new AbsolutePanel(); panel.add(tf); win.add(panel); tf.setPosition(10, 10); win.show(); } }
-
16 Feb 2012 3:59 AM #3
Yes, that is the right direction. Window is a simplepanel and so its child will be sized according to the window. You need to add a layer in between, your AbsolutePanel now.
-
16 Feb 2012 4:46 AM #4
Thank you for reporting this bug. We will make it our priority to review this report.


Reply With Quote