Although this seems to be the ordinary
expanded/leaf/hasChildren problem that is normally due
to the tree not being setup properly, i haven't quite
figured it out yet. May be missing something.
So what happens is this:
-I have a tree2 with some nodes.
-I also have a few checkboxes that change what is
being displayed in the tree.
-When i click on the checkbox, i discard the old tree
and create and populate a new one. its a small tree,
so it's ok.
The problem is as follows:
-in the new page i have a non-displayed root with 2
children folders, each one with some children items.
-i expand one of the folders.
-i click on the checkbox and i get an exception:
12:40:04,493 INFO [STDOUT]
javax.servlet.ServletException: Encountered a node
[0:0] + with an illogical state. Node is expanded but
it is also considered a leaf (a leaf cannot be
considered expanded.
I had considered that there was a problem with my tree
state when i created the new tree and added the child
nodes.
But that is not what it happens. It took me quite a
while to understand and use effectivly tree2, as i had
to develop a few custom classes for nodes and tree,
but it works fine now.
What happens, is this:
-when i click on the checkbox, i get a getTree call
BEFORE my changes are done.
-That getTree call returns the OLD tree, with the old
tree state, where i have a 0:0 expanded node.
-The new tree is created and populated.
-The 0:0 node is a leaf node, and not expanded in the
tree state.
-I receive several new calls to getTree, but now i
have the new Tree, with the correct expanded state -
none are expanded.
-I get the exception
>From what i understand, i get this exception because
the first call returned an expanded state that is not
correct, because it conflicts with the new tree.
Am i missing something here or is it suposed to work
like this ? If so, how can i totally change the tree
being displayed without getting this exception ?
If i don't expand any of the nodes there is no
problem, as it is to be expected.
Any help would be appreciated.
Regards
Guilherme Gomes
__________________________________
Yahoo! Mail - PC Magazine Editors' Choice 2005
http://mail.yahoo.com