-
10 May 2009 8:26 AM #1
2.0-m1 modifying label style on a combobox field messes up the empty field warning
2.0-m1 modifying label style on a combobox field messes up the empty field warning
GWT 1.6, GXT 2.0-m1 (built as of 5/10/09), Hosted mode
When you have a ComboBox field, and:
- you style the label with a margin component
- you set allowBlank to false
The warning image will not appear in the right place (on top of the combo box arrow).
By contrast applying the same formatting to a TextField works fine.
The example code is below- just tab through the two fields, without any input to demonstrate.
public class Test implements EntryPoint {
public void onModuleLoad() {
Window w = new Window();
w.setHeading("my favorite variables");
w.setWidth(500);
w.setAutoHeight(true);
w.setShadow(true);
w.add(new TestForm(w));
w.show();
}
static class TestForm extends LayoutContainer {
Window w;
TestForm(Window w) {
this.w = w;
FormLayout fl = new FormLayout();
fl.setDefaultWidth(300);
fl.setLabelWidth(100);
setLayout(fl);
setAutoHeight(true);
}
@Override
protected void onRender(Element parent, int index) {
super.onRender(parent, index);
// Some fields
TextField foo = new TextField();
foo.setFieldLabel("foo");
foo.setAllowBlank(false);
foo.setLabelStyle("font-size:16px;margin-right:1em");
SimpleComboBox bar = new SimpleComboBox();
bar.setFieldLabel("bar");
bar.setLabelStyle("font-size:16px;margin-right:1em");
bar.add("Foo");
bar.add("Bar");
bar.add("Baz");
bar.add("Quux");
bar.setAllowBlank(false);
add(foo);
add(bar);
}
}
-
10 May 2009 8:28 AM #2
Your post is missing significant details again. In which browser do you ahve the issues?
-
10 May 2009 8:30 AM #3
-
10 May 2009 8:32 AM #4
Hostedmode can be safari, IE or firefox

-
10 May 2009 8:36 AM #5
-
10 May 2009 8:40 AM #6
The erroraligning is bound to a bug in the aligning method for browsers using the webkit engine. This will be fixed with the next milestone.
-
10 May 2009 8:47 AM #7
-
10 May 2009 9:40 AM #8
You should also not use margin-right there. Browsers display margin differently. You can defnie the labelWidth with setLabelWidth
Thank you for reporting this bug. We will make it our priority to review this report.


Reply With Quote