Hi Tim,
Tim Hooper wrote:
I noticed in an application I am building that when I collapse the Root node in
my tree, it will not expand again. So, there's no way for the user to expand
it.
I then tried the Click example (PlainTreePage.java) to set the root node
displayed = true. When I did that, the same thing happens...the root node will
collapse but not expand.
The PlainTreePage example has this line:
tree.expand(existingRootNode);
If you are displaying the rootNode, you have to remove the line above.
A bit of explanation is needed: the Tree doesn't actually know if it
should expand or collapse a node for a user request. What it does is
detect if a specific node id is specified as a request parameter and
then it flips the expand/collapse value of the node. So if the node is
expanded and a node id is detected in the request, it will collapse
the node and vice versa.
By having the line above the root node is always placed in an expanded
state, thus when the user clicks the expand icon, a double flip
occurs, first the rootNode is expanded by the line above, then the
Tree collapses the rootNode during processing.
Hope this helps.
kind regards
bob