Sorry for troubling you guys, but i am having a few
dificulties dealing with tree2.
I am using it dynamically, that is, the user creates
the nodes, gives them names, and saves them.
This part works fine.
The problem is when i create a node that is a children
to another node.
After the user has selected a node, when he presses
the create button, i am adding a node to the parent
node.
The child node consists of an inputText and a button
to save the name.
The problem is that the parent node is not expanded.I
have read about the TreeState, so i added it, and i
programatically set the parent node to expanded, but
it does not work.
Only if i manually click on the + sign does the parent
node display the new children node.
Some code:
initialization:
root = new TreeNodeBase("foo-folder", "Inbox","0",
true);
state = new TreeStateBase();
tree = new TreeModelBase (root);
tree.setTreeState(state);
Here is what i am doing in order to expand the parent
node:
temp = new TreeNodeBase("edit","Insert
Text",""+counter,true);
//selected is the parent node
selected.setLeaf(false);
selected.getChildren().add(temp);
if(!state.isNodeExpanded(selected.getIdentifier()))
state.toggleExpanded(selected.getIdentifier());
And the result is that the parent node is not expanded
at all.
So the ideia is for the parent node to expand and show
the new children with the edit controls.
Any ideias ?
Guilherme Gomes
____________________________________________________
Start your day with Yahoo! - make it your home page
http://www.yahoo.com/r/hs