Uploaded image for project: 'ZK'
  1. ZK
  2. ZK-3905

listbox selectAll checkbox stops synchronizing

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Normal
    • Resolution: Fixed
    • Affects Version/s: 8.5.1
    • Fix Version/s: 8.5.2
    • Component/s: Components
    • Security Level: Jimmy

      Description

      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.:

      1. when "One" is selected -> selecting "Two" doesn't update the selectAll checkbox anymore
      2. 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>
      

        Activity

        Hide
        JamesChu JamesChu added a comment -

        Fixed since 2018/05/30

        Show
        JamesChu JamesChu added a comment - Fixed since 2018/05/30

          People

          • Assignee:
            CharlesQiu CharlesQiu
            Reporter:
            cor3000 cor3000
          • Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Time Tracking

              Estimated:
              Original Estimate - 1 day
              1d
              Remaining:
              Time Spent - 5 hours Remaining Estimate - 3 hours
              3h
              Logged:
              Time Spent - 5 hours Remaining Estimate - 3 hours
              5h