-
FEATURED COMPONENTS
First time here? Check out the FAQ!
We are having some problems with selecting an item on a combobox. Sometimes, when the users selects one of the possible options on the combobox, the selected item is null, but the user’s choice, the value that the selected item should have, has been communicated to the viewmodel and has influenced our forms. For us this an error because the user is choosing an option that exists and then the selection in cleared. We didn’t detect this problem until a few months ago and the number of times this has happened has been increasing.
This are the conditions we have on the project: • Our comboxes are autodroppable and use autocomplete. • The comboboxes have an event listener. When the focus leaves the combobox, if the selected item is null the combobox has to clear the value inputed by the user. It was a request so the user can see that the inputed value wasn’t found on the combobox. o We deleted this behavior to see if it was the cause of the problem and it wasn’t. • The models used for the comboboxes extend the SimpleListModel. o They are initiated with an empty list and everytime the getSubModel method is called, we communicate with the database using a webservice. Also the max number of results our submodels can have is 10. I tried to replicate this problem in the zk-fiddle, it wasn’t very easy, because it doesn’t have the same conditions, the example isn’t using webservices and isn’t communicating with the database, so to emulate a big delay of the webservice I have put a Thread.sleep.
On the example you can see a combobox and a textbox. The selectedItem of the combobox and the value of the textbox are binded to the same property on the viewmodel. If you try different ways to choose the value of combobox (ex: write a character and wait before the second character).
Here is the example: zkfiddle.org/sample/37tfq7f/6-Autocomplete-P
Asked: 2017-03-10 14:14:53 +0800
Seen: 38 times
Last updated: Mar 13 '17
How to capture onScroll Event of Combobox
combobox does not scroll autocompleted text into view
I want to take different value from label(value) and pass to @bind object
zk combobox filtering option is not working inside listbox .
Zk create custom event for COmbo box?
Fetching Key-Value pair for ComboBox using SimpleListModel
How to set selected combobox when using setModel
ComboBox autocomplete does not work with onOk event [closed]