I have faced some problems with removing node from JSF TreeModel tree. Is it possible to somehow remove node from TreeModel object?
Please see snippet below:
TreeModel treeModel = getModel();
for (int j = 0; j < treeModel.getRowCount(); j++) {
MyTreeNode node = (MyTreeNode)treeModel.getRowData(j);
if (node.needsRemoval()) {
}
}
Your assistance is very appreciated! Thanks!
Found answer - TreeModel extends DataModel class, which is abstraction around data collection provided in setWrappedData() method. So as far as I understood, there is no way to change tree model nodes, however you can tamper with data collection and reattach it with setWrappedData(). Please let me know if I am wrong.