Mathias is right about the nodeIdentifier.

I wonder if we could make more use of the _selectedNodeId field in
HtmlTree?  Right now it is set through events but its not available to
outside classes ...

What do you think?

sean



On 8/22/05, [EMAIL PROTECTED]
<[EMAIL PROTECTED]> wrote:
>  
> The problem is selected.getIdentifier()does not return the String that is
> used in the TreeState for storing the expanded nodes. 
> The TreeState does not use the TreeNode.identifier. 
> You have to provide a NodeId String that represents the path to the node in
> the model like "0:1:2". Currently there is no method in the TreeModel that
> generates this NodeId or Path for a given TreeNode instance. 
>  
> [EMAIL PROTECTED] schrieb am 22.08.2005 14:28:42:
> 
>  
>  > 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 
>  >  
>

Reply via email to