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

<treeitem checkable="false" /> is ignored in ZK8

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Open
    • Priority: Normal
    • Resolution: Unresolved
    • Affects Version/s: 8.0.1.1
    • Fix Version/s: None
    • Component/s: Components
    • Labels:
    • Environment:

      win7
      tomcat8
      chrome v52

      Description

      Attribute checkable="false" is ignored in ZK8

      MyModel.java
      package tst;
      
      import java.util.Arrays;
      
      import org.zkoss.zul.DefaultTreeModel;
      import org.zkoss.zul.DefaultTreeNode;
      
      public class MyModel {
      
          public DefaultTreeModel<String> getTreeModel() {
              return new DefaultTreeModel<>(node("root",
                      node("item1", node("item11", node("item111"), node("item112"))),
                      node("item2", node("item21", node("item211")), node("item22", node("item221")))
              ));
          }
      
          @SafeVarargs
          private static DefaultTreeNode<String> node(String name, DefaultTreeNode<String>... children) {
              return (children.length == 0) ? new DefaultTreeNode<>(name) : new DefaultTreeNode<>(name, Arrays.asList(children));
          }
      }
      
      tst.zul
      <zk>
          <window viewModel="@id('vm') @init('tst.MyModel')">
              <tree model="@init(vm.treeModel)" onSelect="alert(event.getSelectedObjects());">
                  <template name="model">
                      <treeitem label="${each}" checkable="false" />
                  </template>
              </tree>
          </window>
      </zk>
      

      Expected behaviour: nodes should not be selectable
      Actual behaviour: nodes are selectable

        Attachments

          Activity

            People

            Assignee:
            Unassigned
            Reporter:
            qqtt qqtt
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Dates

              Created:
              Updated: