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

Selection bug on listbox using checkmarkDeselectOthers functionality

XMLWordPrintable

    • ZK 8.0.2 S1

      I found one issue on selection when the property checkmarkDeselectOthers is active.

      After selecting all elements using the checkmark, when user clicks in one item for deselecting others, the selection in server is not updated. I made one video to demonstrate the problem.
      In attachment:

      • one video demonstrating the problem,
      • the zul file and the viewmodel from video.
        I was unable to demonstrate this problem in zk sandbox because the property org.zkoss.zul.listbox.checkmarkDeselectOthers must be enabled.
      zk.xml
      <library-property>
          <name>org.zkoss.zul.listbox.checkmarkDeselectOthers</name>
          <value>true</value>
      </library-property>
      
      ZKBugViewModel.java
      public class ZKBugViewModel {
         private final ListModelList<String> model;
      
         public ZKBugViewModel() {
              this.model = new ListModelList<String>();
              for (int i = 1; i < 10; i++) {
                  this.model.add("Value " + i);
              }
              this.model.setMultiple(true);
          }
      
          public ListModelList<String> getModel() {
              return this.model;
          }
      }
      
      zkbug.zul
      <zk>
        <window apply="org.zkoss.bind.BindComposer" width="300px"
          viewModel="@id('vm') @init('com.test.gui.viewmodels.ZKBugViewModel')">
          <vlayout>
            <listbox id="grid" width="450px" height="280px" model="@load(vm.model)" checkmark="true"
              onSelect='count.setValue("Selected elements count: " + grid.getSelectedCount())'>
              <listhead>
                <listheader label="Some title" />
              </listhead>
              <template name="model">
                <listitem label="@load(each)" />
              </template>
            </listbox>
            <label id="count" style="font-size: 20px; font-weight: bold;"
              onCreate='count.setValue("Selected elements count: " + grid.getSelectedCount())' />
          </vlayout>
        </window>
      </zk>
      

            DevChu DevChu
            eclipse2 eclipse2
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved:

                Estimated:
                Original Estimate - Not Specified
                Not Specified
                Remaining:
                Remaining Estimate - 0 minutes
                0m
                Logged:
                Time Spent - 4 hours
                4h