-
Bug
-
Resolution: Fixed
-
Normal
-
8.5.1
-
Security Level: Jimmy
-
None
Steps to Reproduce
<zk> <listbox id="lb" multiple="true" checkmark="true"> <listhead> <listheader label="name"/> </listhead> <listitem label="One" /> <listitem label="Two" /> </listbox> <button label="clear selection" onClick="lb.clearSelection()"/> </zk>
Current Result
when toggling items "One" and "Two" individually the selectAll checkbox synchronizes automatically
also the "clear selection" button removes unchecks all 3 checkboxes as expected
Problems happen after checking selectAll once (using the checkbox in the listheader)
-> the automatic synchronization fails ...
e.g.:
- when "One" is selected -> selecting "Two" doesn't update the selectAll checkbox anymore
- when all 3 are checked, clicking "clear selection" doesn't update the selectAll checkbox
Expected Result
keep selectAll in sync with individual checkboxes
Workaround
use a ListModelList with a listitem-template (here an example using zscript, also possible in java)
<zk> <zscript><![CDATA[ ListModelList items = new ListModelList(); items.add("One"); items.add("Two"); items.setMultiple(true); ]]></zscript> <listbox id="lb" model="${items}" checkmark="true"> <listhead> <listheader label="name"/> </listhead> <template name="model"> <listitem label="${each}"/> </template> </listbox> <button label="clear selection" onClick="items.clearSelection()"/> </zk>
- relates to
-
ZK-4606 clicking select-all checkbox in a Listbox doesn't select all items
- Closed