-
Type:
Bug
-
Resolution: Unresolved
-
Priority:
Normal
-
None
-
Affects Version/s: 9.6.0, 10.0.0
-
Component/s: None
-
Security Level: Jimmy
-
None
Steps to Reproduce
https://zkfiddle.org/sample/3nptg2s/5-Listbox-selectedItems-form-binding
Run fiddle
In the Section B - Form binding, click the "select first item" button
Current Result
item is added to the selection list (below), load binding triggers on Listbox's selectedItems attribute, but selection is not changed in the Listbox with model (B-2).
Expected Result
Selection status changes for selected items.
Debug Information
As this stage, the listitem value is a FormProxyObject of the data.
Since the default ListboxSelectedItemsConverter implementation will use model.contains(bean) or check (listItems values).contains(bean), and there is no equality between the formProxyObject and the origin bean, the converter will not change the selection state of the listitems.
Workaround
If the content of the data items located in the model do not change (only the model as a list), then the model can be marked with the @immutableItems annotation.
Otherwise, a custom converter based on the original ListboxSelectedItemsConverter can be implemented (see workaround section in fiddle)
- relates to
-
ZK-4982 Listbox (mold select with groups) fail when selecting from serverside
-
- Closed
-