Steffen,
I have the same problem, to solve it i destroy the tree component in the jsf model, when you update the tree structure.
Adrien
Steffen Hankiewicz wrote:
Hi all,
I have a little problem with my treeview. I'd like to give the user the possibility to change the order of the tree items. Now the user for example clicks a button to move the current node up to another parent (the parent of his parent). Until now all works fine. The node gets indeed another parent. But in my form the tree never gets updated. I tried all I can. But the tree never gets reloaded. The node stays visually under its former parent.
Can you give me any advise, how to solve this problem?
Thanks a lot,
Steffen
Here is my code so far:
--------------------------------
/** * move node up */ public String NodeUp() { myLogger.debug("Metadaten() - NodeUp() Start");
// get the parents DefaultMutableTreeNode oldFather = (DefaultMutableTreeNode) myNode.getParent(); DefaultMutableTreeNode newFather = (DefaultMutableTreeNode) myNode.getParent().getParent(); myLogger.info("old father: " + oldFather); myLogger.info("new father: " + newFather);
// set the new parent myNode.setParent((DefaultMutableTreeNode) newFather); myLogger.info("new father after: " + myNode.getParent().toString());
// all these commands don't update the tree // myTree.nodeStructureChanged(newFather); // myTree.nodeStructureChanged(oldFather); // myTree.nodeStructureChanged((DefaultMutableTreeNode) myTree.getRoot());
myLogger.debug("Metadaten() - NodeUp() End"); // show the same page again return null; }
--------------------------------

