title: how to delete a node in <p: tree of primefaces?
body: <p>I am using <code>private TreeNode root;</code> to create a dynamycal tree.</p>
  
  <p>and I used  </p>
  
  <pre><code>&lt;p:tree value="#{bean.root}" var="node"&gt;
      &lt;p:treeNode&gt;
          h:outputText value="#{node}" /&gt;
      &lt;/p:treeNode&gt;
  &lt;/p:tree&gt;
  </code></pre>
  
  <p>to display it in my page.</p>
  
  <p>my question is how to remove the nodes that are empty (doesn't contain a child)</p>
  
  <p>exemple :</p>
  
  <pre><code>node1
     child 1
     child 2
  node2 
  node3
    child 1
  </code></pre>
  
  <p>(node 2 is empty, how to remove it?)</p>