-
2 Nov 2012 7:05 AM #1
Unanswered: SimpleComboBox setForceSelection(false) not working
Unanswered: SimpleComboBox setForceSelection(false) not working
Hi,
I have a SimpleComboBox with some predefined values. The ComboBox should not be limited to these values, but after I type "Senator" and leave the combobox, the value is set to null...
Thank you!
mm
Code:public class TestCase implements EntryPoint { @Override public void onModuleLoad() { SimpleComboBox<String> comboTitle = new SimpleComboBox<String>( new StringLabelProvider<String>()); comboTitle.setTriggerAction(TriggerAction.ALL); comboTitle.setEditable(true); comboTitle.setAllowBlank(false); comboTitle.setForceSelection(false); comboTitle.add("Dr."); comboTitle.add("Prof."); comboTitle.add("Dipl.Ing."); VerticalLayoutContainer p = new VerticalLayoutContainer(); p.add(new FieldLabel(new TextField(), "Name"), new VerticalLayoutData(1, -1)); p.add(new FieldLabel(comboTitle, "Title"), new VerticalLayoutData(1, -1)); p.add(new FieldLabel(new TextField(), "Address"), new VerticalLayoutData(1, -1)); FormPanel f = new FormPanel(); f.setWidth(350); f.add(p); RootPanel.get().add(f); } }
-
7 Nov 2012 5:23 AM #2
Hi,
I kindly ask for an answer. Is this a bug, or am I doing something wrong?
I can not type any new values into my SimpleComboBox.
I have tried to catch the BlurEvent, but I can not find out the value user has Typed into ComboBox.
m
-
7 Nov 2012 7:03 AM #3
There is a bug related to setForceSelection(false) not working, but that said, even if it were fixed to the same behavior in 2.x, it wouldn't return something other than null, it just wouldn't clear the value.
Instead, you almost certainly want a customer PropertyEditor that returns the raw string instead of only finding values in the store you provided.
The bug is filed at http://www.sencha.com/forum/showthread.php?196281, and I went into more depth there about a month ago at the top of the second page.


Reply With Quote