-
15 Jan 2012 10:14 AM #1
FieldLabel: fieldSeparator is shown even you set the separator to "" for a field
FieldLabel: fieldSeparator is shown even you set the separator to "" for a field
I would expect, that it is possible to set a for one field in a form.
-
11 Feb 2012 3:31 PM #2
This works for me:
label.setLabelSeparator("");
label.setText(""); // set any text
-
12 Feb 2012 8:37 AM #3
It works! Thanks
@Sencha:
Is it possible to add the label separator to the signature of the constructor?
Something like that:
public FieldLabel(Widget widget, String label, String labelSeparator) {
this(widget);
this.labelSeparator = labelSeparator;
setText(label);
}
public FieldLabel(Widget widget, String label, String labelSeparator, FieldLabelAppearance appearance) {
this(widget, appearance);
this.labelSeparator = labelSeparator;
setText(label);
}
This will save some code.
-
12 Feb 2012 8:40 AM #4
Normally you do not change the separator so often. This means having extra a contructor for this does not make so much sense. If you require this, you can easily subclass FieldLabel and add this to your own contructor.
-
12 Feb 2012 8:50 AM #5
Creating large forms with a lot of fields might be annoying, because you need four statements to do the same thing you can do with one having these constructor.
FieldLabel fl = new FieldLabel(widget, "", "");
fl.setLabelSeparator("");
fl.setText("");
fc.add(fl, new VerticalLayoutData(1, -1));
compare to
fc.add(new FieldLabel(widget, "", ""), new VerticalLayoutData(1, -1));
Of course, I can subclass FieldLabel, but this looks a little bit nicer to me... ;-)
-
12 Feb 2012 10:18 AM #6
This is only the case when you really want to change the separater, which, as i said, is not used that often. If you do not want to change it than there is already a contructor which only takes the label.
-
12 Feb 2012 10:48 AM #7
I think it is misleading behaviour: you can specify separator character using UiBinder but it does not take any effect! It is impossible to initialize widget that way. Why then have a setter for it at all, if we can subclass the FieldLabel and do it the right way? Same is for setting field label length (there is a post in the thread): you cannot change it after the label has been constructed, though there is a public setter for it

-
15 Feb 2012 1:16 PM #8
+1
Please, guys, think about UiBinder users too.
UiBinder is one of the major benefits of GXT 3.0, right?Konstantin Scheglov
-
15 Feb 2012 2:02 PM #9
UiBinder users should not be effected by this request at all.
-
15 Feb 2012 4:51 PM #10
Actually as Konstantin told, UiBinder is affected.
FieldLabel.setText() uses "labelSeparator".
But when "labelSeparator" is set, it does not change text!
Look into BeanParser.
"setterValues" is {text="myText", labelSeparator="sss"} here, because it is HashMap, so order of items is almost random. So, problem is that FieldLabel is not actually bean, because its behavior depends on order of setters calling.Code:for (Map.Entry<String, String> entry : setterValues.entrySet()) { String propertyName = entry.getKey();
We had same problem during developing GXT 2.x support in GWT Designer.
But that was Java and we can solve this by using "correct" (i.e. expected by Ext GWT) order of setters calling. I'm not sure what to do in case of UiBinder...
Success! Looks like we've fixed this one. According to our records the fix was applied for
a bug in our system
in
a recent build.


Reply With Quote