getValue() returns list with null value after filtering
jensgoe opened this issue · 5 comments
Steps to reproduce:
- create MultiSelectComboBox and a Button to invoke getValue()
- add more items than pageSize (server-side filtering is used)
- select an item ("item 0")
- type some text (e.g. "155), so that items got filtered until one item is shown ("item 155")
- select that item
- now two items are selected in MultiSelectComboBox ("item 0" and "item 155")
- push the button
getValue() now returns a list like [null, "item 155"]
My investigation:
The for-loop in MultiSelectComboBox.presentationToModel() calls for each item in the combo-box set.add(multiselectComboBox.getKeyMapper().get(key));
. The keyMapper does not know something about the first selected item, because the filtering cleared all keys and created new ones.
Workaround
call setPageSize() to a number higher than items are in the MultiSelectComboBox. I guess client side filtering does not clear the keyMapper cache.
I hope you can follow my description.
Hi @jensgoe
Thanks for reporting this issue and for your investigation. I have moved it here, as this is the correct repository.
Hi, I've downloaded 2.4.0 release today and the issue still occurs. Is it possible that something happened between 2.3.1 and 2.4.0?
Hi @GPiotr
There are some changes, but nothing that should've impacted this (at least I did not notice any issues).
Can you reproduce the issue here: https://multiselect-combo-box-flow.herokuapp.com/lazy-loading ?
Woah! You are fast.
I've checked the live demo and cleaned my project within the rebuild.
Seems that everything is working fine.
Sorry for troubling you.