-
11 Jun 2008 1:01 AM #1
[FIXED] bug in DateField resizing in FormPanel
[FIXED] bug in DateField resizing in FormPanel
Hi
I have a next piece of code:
DateField resizing doesn't work and I have that field bigger than others. Resizing of other fields in my FormPanel doesn't work too. If I writeCode:FormPanel formPanel = new FormPanel(); formPanel.setHeaderVisible(false); formPanel.setLabelWidth(100); formPanel.setFieldWidth(210); formPanel.setIconStyle("icon-form"); formPanel.setFrame(true); formPanel.setWidth(400); formPanel.setButtonAlign(Style.HorizontalAlignment.CENTER); formPanel.setScrollMode(Style.Scroll.AUTO); DateField birthDateField = new DateField(); birthDateField.setFieldLabel(MCMessages.msg.contact_birthdate()); birthDateField.getPropertyEditor().setFormat(DateTimeFormat.getFormat("dd.MM.yyyy")); birthDateField.setWidth(193); formPanel.add(birthDateField);
than resizing of all fields works except for DateField. And if I writeCode:formPanel.setFieldWidth(0);
than resizing works well for all fields in the FormPanelCode:formPanel.setFieldWidth(-1);
-
12 Jun 2008 6:51 AM #2
FormLayout now honors the field's width if it has been specified. Fix is in SVN.
-
17 Jun 2008 5:52 AM #3
In order to override the width of any fields, you should use a FormData and specify a width. Setting the width on the field itself will not work.
-
17 Jun 2008 9:35 AM #4
on beta5 next code
gives an error:Code:FormPanel formPanel = new FormPanel(); formPanel.setHeaderVisible(false); formPanel.setLabelWidth(100); formPanel.setFieldWidth(235); formPanel.setFrame(true); formPanel.setButtonAlign(Style.HorizontalAlignment.CENTER); birthDateField.setFieldLabel("Birthday"); birthDateField.getPropertyEditor().setFormat(DateTimeFormat.getFormat("dd.MM.yyyy")); FormData fd = new FormData(); fd.setWidth(218); formPanel.add(birthDateField, fd);
maybe in SVN its already fixed, i don't knowCode:[ERROR] Uncaught exception escaped java.lang.ClassCastException: com.extjs.gxt.ui.client.widget.layout.FormData at com.extjs.gxt.ui.client.widget.layout.AnchorLayout.onLayout(AnchorLayout.java:93) at com.extjs.gxt.ui.client.widget.layout.FormLayout.onLayout(FormLayout.java:191) at com.extjs.gxt.ui.client.widget.Layout.layout(Layout.java:68) at com.extjs.gxt.ui.client.widget.Container.doLayout(Container.java:252) at com.extjs.gxt.ui.client.widget.Container.layout(Container.java:343) at com.extjs.gxt.ui.client.widget.LayoutContainer.layout(LayoutContainer.java:235) at com.extjs.gxt.ui.client.widget.Container.doLayout(Container.java:259) at com.extjs.gxt.ui.client.widget.Container.layout(Container.java:343) at com.extjs.gxt.ui.client.widget.LayoutContainer.layout(LayoutContainer.java:235) at com.extjs.gxt.ui.client.widget.Container.doLayout(Container.java:259)
-
17 Jun 2008 1:00 PM #5
FormData needs to extend AnchorData which it does not in b5. This is correct in SVN.
-
18 Jun 2008 8:56 AM #6
This still doesn't work for me using the latest from SVN as of Wednesday 18th. I have code as follows:
FormPanel form = new FormPanel();
form.setHeaderVisible(false);
form.setFrame(false);
form.setBodyBorder(false);
form.setLabelWidth(100);
TextField<String> field = new TextField<String>();
form.add(field, new FormData(150, 0));
field.setLabelStyle("color: darkgray;");
field.setLabelSeparator("");
field.setFieldLabel("Test Label:");
field.setWidth(150);
field.setValue("Test Value");
----
The field width of "150" is not honored.
-
18 Jun 2008 9:01 AM #7
There is a slight change, you need to use a FormData instance to specify the field width (see the previous posts).
-
18 Jun 2008 9:07 AM #8
-
18 Jun 2008 9:36 AM #9
Sorry about that. I scanned your code and saw the line where you were setting the width directly first. There was a bug, the fix is in SVN.


Reply With Quote