Sunday, January 29, 2012

Re: Celltree - Add, Update, Remove Nodes

Here an example of my second try.
I tried to close/reopen the nodes to refresh the tree but sadly
without success.
The refresh for adding is working but not for removing a node.

I replaced my refresh method by following two methods.
Still no help?

public void refresh() {

closeReopenTreeNodes(cellTree.getRootTreeNode());
}

private void closeReopenTreeNodes(TreeNode node) {
if(node == null) {
return;
}
for(int i = 0; i < node.getChildCount(); i++) {

if(node.getChildValue(i).equals(this)){

if(node.getParent() != null){

node.getParent().setChildOpen(i, false);
//node.getParent().setChildOpen(i, true);
}

node.setChildOpen(i, false);
node.setChildOpen(i, true);
}
TreeNode child = node.setChildOpen(i, node.isChildOpen(i));
closeReopenTreeNodes(child);
}
}

--
You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group.
To post to this group, send email to google-web-toolkit@googlegroups.com.
To unsubscribe from this group, send email to google-web-toolkit+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.

No comments:

Post a Comment