Hybrid View
-
17 Apr 2012 9:03 AM #1
GXT 3-rc2 ComboBox: setForceSelection(false) does not work
GXT 3-rc2 ComboBox: setForceSelection(false) does not work
If you setForceSelection(false), I would expect the typed text to remain in the combo box when you unfocus. Not the case. Also clears when you hit enter.
-
17 Apr 2012 9:25 AM #2
probably related to the other bug I see with the label provider
-
17 Apr 2012 5:47 PM #3
Thanks for the report. You're right - this doesn't match the description provided. I've filed a bug against the team and will update here with any progress.
-
17 Apr 2012 6:03 PM #4
-
18 Jul 2012 1:00 PM #5
Any update on this. It was reported with a RC2, but I still see this behavior in 3.0.0b.
-
26 Jul 2012 12:20 PM #6
Hi ! Does this bug has been resolved ? I've searched for a workaround, but unfortunately I've found nothing...
-
4 Oct 2012 1:04 AM #7
ComboBox, ClearValueOnParseError
ComboBox, ClearValueOnParseError
I set to combo box following:
setClearValueOnParseError(false);
I do the same thing with date component.
I start application, enter invalid string to both component, result- first component is cleared, second is not cleared.
Is there any workaround to leave invalid value in combo?
-
11 Oct 2012 2:06 AM #8
Same problem
Same problem
setClearValueOnParseError(false);
setForceSelection(false);
I set those two properties on my combobox because I need to accept arbitrary text but on blur the content text disapears.
Even with some EventHandlers like BlurHandler, onBlur or onBrowserEvent I can't get the typed value.
-
11 Oct 2012 7:22 PM #9
Thanks for the report, and the feedback. I wonder if you can give a little more detail on how you are using the ComboBox - if you are using it to store and filter Strings, I have another suggestion that might make sense.
Make is a ComboBox<String>, and instead of trying to tell the ComboBox that the new string is merely not an error, give it a custom PropertyEditor<String> instead. The purpose of a PropertyEditor (the name is a holdover from 2.x, before there was such a thing as the Editor framework) is to turn the text the user enters into a value that can be used from code, and vice versa - how to print the values from model objects into text on the screen.
The default PropertyEditor for ComboBox (actually for the ComboBoxCell) is ComboPropertyEditor - it uses the protected method T selectByValue(String) to try to figure out what value in the store matches the current string.
If, as I said, you want to support any string value, this is a great way to add a value to the Store if it fits, or to just say 'yep, that string is a string, and strings are values' - no need to test against every value in the store.
That said, yes, our current behavior on clearValueOnParseError=false clearly doesn't make sense, and it is quite possible that forceSelection doesn't make sense given the differences between 2.x and 3. I'm currently focusing on how we can make clearValueOnParseError work - and trying to ensure that it will be enough to satisfy the forceSelection behavior.
-
11 Oct 2012 7:29 PM #10
Merging two threads to allow discussion on these two setters and how the PropertyEditor can be used.
I'm currently of the opinion that if a non-matching value is entered, it should be drawn as an error, and clearValueOnParseError and forceSelection *only* govern what to do with regard to the old errors. ForceSelection=true would avoid the issue by selecting some value (last, or closest match), and if false, then either the string should be retained or cleared (clearValueOnParseError). If you want the value to be not only kept but made available from comboBox.getValue, then a new PropertyEditor is in order. Thoughts?
You found a bug! We've classified it as
EXTGWT-1932
.
We encourage you to continue the discussion and to find an acceptable workaround while we work on a permanent fix.


Reply With Quote