Reputation: 223
I need to find whether the tree in primeface have child or not . When I select node in tree I need to find its having child or not.
Upvotes: 1
Views: 979
Reputation: 3164
You can check number of child with method getChildCount.
The getChildCount()
will return 0 whenever selected node do not contains any children nodes.
public void onNodeSelect(NodeSelectEvent event) {
TreeNode node = event.getTreeNode();
System.out.println("node.getChildCount(): " + node.getChildCount());
}
Upvotes: 2