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