I'm working with the primefaces treetable and I'm trying to create buttons on each row so that a user can reorder the elements in a tree table.
For example, if i have a tree table with 3 nodes all at the same level, and each of those three nodes in the treetable has an "Up" button, if the up button is clicked on one of the nodes, I want that node to move up (basically reorder the nodes).
How can i get the index of of the selected node?
for(int i = 0; i < selectedNode.getParent().getChildren().size(); i++) {
// how can i compare the index of the current child in the loop to the selected child?
}
TreeNode
having an index? – siebz0r