title: Primefaces p:tree commandButton action not working
body: <p>When I click buttons near node0, node1, node2, it is printing "TEST on the console. However, when I click on others, it is not working. What can be the problem?    </p>
  
  <pre class="lang-xml prettyprint-override"><code>&lt;h:form id="form"&gt;  
      &lt;p:tree value="#{treeBean.root}" var="node" id="tree" dynamic="true"&gt;  
          &lt;p:treeNode id="treeNode"&gt;
              &lt;p:commandButton value="test" action="#{treeBean.test()}" /&gt;
              &lt;h:outputText value="#{node}" id="lblNode"/&gt;  
          &lt;/p:treeNode&gt;  
      &lt;/p:tree&gt;  
  &lt;/h:form&gt;
  </code></pre>
  
  <pre class="lang-java prettyprint-override"><code>public class TreeBean {  
  
      private TreeNode root;  
  
      public TreeBean() {  
          root = new DefaultTreeNode("Root", null);  
          TreeNode node0 = new DefaultTreeNode("Node 0", root);  
          TreeNode node1 = new DefaultTreeNode("Node 1", root);  
          TreeNode node2 = new DefaultTreeNode("Node 2", root);  
  
          TreeNode node00 = new DefaultTreeNode("Node 0.0", node0);  
          TreeNode node01 = new DefaultTreeNode("Node 0.1", node0);  
  
          TreeNode node10 = new DefaultTreeNode("Node 1.0", node1);  
          TreeNode node11 = new DefaultTreeNode("Node 1.1", node1);  
  
          TreeNode node000 = new DefaultTreeNode("Node 0.0.0", node00);  
          TreeNode node001 = new DefaultTreeNode("Node 0.0.1", node00);  
          TreeNode node010 = new DefaultTreeNode("Node 0.1.0", node01);  
  
          TreeNode node100 = new DefaultTreeNode("Node 1.0.0", node10);  
      }  
  
      public TreeNode getRoot() {  
          return root;  
      }  
  
      public void test(){
          System.out.println("TEST");
      }
  }
  </code></pre>