I'm having a hard time understanding how I can update things like the
label of a node in the cell tree when I know its value has changed in
the model being viewed. Right now I have a rather brute force
approach: I update the entire set of children for the parent by
calling AbstractDataProvider.updateRowData. At least it works, but
it's like a sledge hammer. I have yet to figure out how to update
just the one child; maybe I just ran into bugs in the older pre-
release versions and have to try again. Also, I have to do similar
things if children are added, i.e., if a node y has a child z added,
and originally y had no children, I have to tell the parent node x of
y to update all its children so that it updates the expansion icon to
reflect that y is no longer a leaf. But, now matter how hard I wrack
my brain, I cannot find a way to make a node go from having children
back to being a leaf again. The only way I can get this to work is to
hack the code:
// Create a set of currently open nodes.
Set<Object> openNodes = new HashSet<Object>();
int childCount = nodeView.getChildCount();
int end = start + values.size();
for (int i = start; i < end && i < childCount; i++) {
CellTreeNodeView<?> child = nodeView.getChildNode(i);
// Ignore child nodes that are closed.
if (child.isOpen() && !child.isLeaf()) { ///////////////
<------ add the test to not save the open state if it's a leaf.
openNodes.add(child.getValueKey());
}
}
Is there any way of making a node go from having children to having no
children again in a CellTree?
--
You received this message because you are subscribed to the Google Groups
"Google Web Toolkit" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/google-web-toolkit?hl=en.