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

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

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Normal Normal
    • None
    • 8.0.1.1
    • Components
    • win7
      tomcat8
      chrome v52

      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

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

              Created:
              Updated: