-
29 Aug 2008 10:41 AM #1
how to check the combobox has a particular value
how to check the combobox has a particular value
How to check whether a particular text is in the combobox or not?
-
30 Aug 2008 4:59 AM #2
Do you mean selection? ie ComboBox.getSelection();
-
12 Sep 2008 11:37 AM #3
unable to get editable combo box text
unable to get editable combo box text
I'm having a similar problem.
So, I have an editable ComboBox. If the user types in a value, how can I get that text? getSelection returns null because nothing in the dropdown area is selected.
I'm using GXT 1.0.4, and am in the process of buying a commercial license.
-Mike
-
12 Sep 2008 12:04 PM #4
what does getValue() return?
-
12 Sep 2008 12:23 PM #5
re: unable to get editable combo box text
re: unable to get editable combo box text
In this case, .getValue() returns null - looks like getValue is using the store, even for an editable combo box with nothing selected (see below, from ComboBox.java):
maybe there needs to be some checking of the "editable" flag? - not sure exactly how to do this, but, in this case, the user-entered value would not be in the store....Code:@Override public D getValue() { if (store != null) { getPropertyEditor().setList(store.getModels()); } return super.getValue(); }

-Mike
-
12 Sep 2008 12:31 PM #6
re: unable to get editable combo box text
re: unable to get editable combo box text
But, getRawValue() does work. So, there's a workaround! Yea!

Thanks,
-Mike
-
15 Sep 2008 6:02 AM #7
I wrote a findMatch to check whether a value exists in Combobox
findMatch: function(prop, value){
var match = false;
if(this.store.getCount() > 0){
this.store.each(function(r){
if(r.data[prop] == value){
match = true;
}
});
}
return match;
}


Reply With Quote