jQWidgets Forums
jQuery UI Widgets › Forums › Lists › ComboBox › ComboBox support empty / null value.
Tagged: #combobox
This topic contains 17 replies, has 3 voices, and was last updated by achiesa 7 years, 10 months ago.
-
Author
-
The implementation of the ComboBox implemented as a custom editor in a grid doesn’t seem to clear the selection if the input is cleared out. The expected result is if I cleared out the text in the input and hit enter to save the value, the new value should be null.
Test case:http://jsfiddle.net/tYFTh/
Hi jgornick,
As far as I see, you return the selected item of the ComboBox. The geteditorvalue function is implemented by you and it is up to you what to return as a result.
Best Regards,
Peter StoevjQWidgets Team
http://www.jqwidgets.comHey Peter,
Yes, I do implement the geteditorvalue which is a proxy to return the combo box selected item. However, what I’m expecting is if I clear out the input for the combo box, the selected item should be null.
The point is, if I type in “abc” it doesn’t match any items and the selected item is null. The same should hold true for if I clear out the input because there aren’t any items that match an empty string.
Any thoughts on this?
Hi jgornick,
The Selected Item would not be removed if you clear the Text.
Best Regards,
Peter StoevjQWidgets Team
http://www.jqwidgets.com/Hey Peter,
Yes, that is what I’m experiencing, but it doesn’t line up with the other behavior of the combo box.
What’s the difference of clearing out the combo box text field vs typing in an invalid item value? When I type in an invalid value, the selected item is null. If I clear the text field the combo box value is persisted. Both of those scenarios result in invalid values which would mean the selected item is null.
Cheers,
– Joe
Hi jgornick,
That is how the widget works. The Input Field’s Value is not necessary to be the Selected Item.
Best Regards,
Peter StoevjQWidgets Team
http://www.jqwidgets.com/Hey Peter,
Based on the reason, the input field should not set the selected item to null if the value entered is not found. Please follow the instructions in the fiddle I created from the original post to see the inconsistent behavior.
– Joe
To beat this horse even more, the combo box doesn’t not provide a user to clear the selection visually. If one wanted to do this, they would have to create another link or button to call the method on the combo box instance. This would warrant the ability to clear the selection by clearing the value in the text field of the combo box.
Hi jgornick,
The selection should be cleared when the input’s value is empty i.e there’s no matching item based on the input string. There should not be any additional UI elements like buttons, clear buttons, etc. That’s just not necessary.
Best Regards,
Peter StoevjQWidgets Team
http://www.jqwidgets.com/Hey Peter,
I just want to make sure I read what you wrote: “The selection should be cleared when the input’s value is empty…”.
If that is the expected behavior, then there is an issue. You can reproduce the issue with my the fiddle found at http://jsfiddle.net/hrcsrl/LtYQe/. Please read the instructions to reproduce the issue.
Cheers,
– Joe
Hi jgornick,
I think that you missed the point of my Post. I explained how the widget should work and if it does not, then we will improve it.
Best Regards,
Peter StoevjQWidgets Team
http://www.jqwidgets.com/Hey Peter,
I get it now
Were you able to verify the issue via my fiddle http://jsfiddle.net/hrcsrl/LtYQe/ ?
Cheers,
– Joe
Bump.
-
AuthorPosts
You must be logged in to reply to this topic.