Re: Problem with dynamic insertion to Tree

2009-05-29 Thread Bucyrus



PSkarthic wrote:
 
 Thanks for your reply
 i have been waiting for long time
 
 
 target.addComponent(this); also does not solved my problem.
 
 if i click a node the child is created under the node but doesn't expanded
 but when i click it second time then it expands but with two child.
 

For me 

@Override
protected void onNodeLinkClicked ( AjaxRequestTarget pTarget, TreeNode
pNode) {
[...]
myNavigationTree.getTreeState().expandNode ( pNode); 
[...]
}

solved that problem. Where pNode is the (sub-tree-) root node under which
new nodes have been added dynamically.
-- 
View this message in context: 
http://www.nabble.com/Problem-with-dynamic-insertion-to-Tree-tp21474815p23776501.html
Sent from the Wicket - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org



Problem with dynamic insertion to Tree

2009-01-15 Thread PSkarthic

I have a problem in inserting/adding nodes dynamically to tree.

When i inserted/added a node on click, the plus icon appears but it is not
expanded, that is it is not showing the child node i have tried tree.update
but not worked.

My Code
protected void onNodeLinkClicked(org.apache.wicket.ajax.AjaxRequestTarget
target,
javax.swing.tree.TreeNode node){
   
MyTreeNode nd = (MyTreeNode)node;
//nd.add(new DefaultMutableTreeNode(sample));
System.out.println(node + Ajax Clicked);
nd.insert(new MyTreeNode(node + child), 0);
   
//this.modelChanged();
//this.nodeExpanded(node);
this.updateTree();
   
   
}

Why it is happening like.



Thanks
Karthic
-- 
View this message in context: 
http://www.nabble.com/Problem-with-dynamic-insertion-to-Tree-tp21474815p21474815.html
Sent from the Wicket - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org



Re: Problem with dynamic insertion to Tree

2009-01-15 Thread Vitek Tajzich
what about call target.addComponent(this);

?

you have updated tree but you didn't tell wicket to update this component
visually...

V.

2009/1/15 PSkarthic kart...@touchpointindia.com


 I have a problem in inserting/adding nodes dynamically to tree.

 When i inserted/added a node on click, the plus icon appears but it is not
 expanded, that is it is not showing the child node i have tried tree.update
 but not worked.

 My Code
 protected void onNodeLinkClicked(org.apache.wicket.ajax.AjaxRequestTarget
 target,
javax.swing.tree.TreeNode node){

MyTreeNode nd = (MyTreeNode)node;
//nd.add(new DefaultMutableTreeNode(sample));
System.out.println(node + Ajax Clicked);
nd.insert(new MyTreeNode(node + child), 0);

//this.modelChanged();
//this.nodeExpanded(node);
this.updateTree();


}

 Why it is happening like.



 Thanks
 Karthic
 --
 View this message in context:
 http://www.nabble.com/Problem-with-dynamic-insertion-to-Tree-tp21474815p21474815.html
 Sent from the Wicket - User mailing list archive at Nabble.com.


 -
 To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
 For additional commands, e-mail: users-h...@wicket.apache.org




Re: Problem with dynamic insertion to Tree

2009-01-15 Thread PSkarthic

Thanks for your reply
i have been waiting for long time


target.addComponent(this); also does not solved my problem.

if i click a node the child is created under the node but doesn't expanded
but when i click it second time then it expands but with two child.
-- 
View this message in context: 
http://www.nabble.com/Problem-with-dynamic-insertion-to-Tree-tp21474815p21476222.html
Sent from the Wicket - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org



Re: Problem with dynamic insertion to Tree

2009-01-15 Thread PSkarthic


Is there anybody to solve this.

I got Stuck here
:working:
I have a problem in inserting/adding nodes dynamically to tree.

When i inserted/added a node on click, the plus icon appears but it is not
expanded, that is it is not showing the child node i have tried tree.update
but not worked.

My Code
protected void onNodeLinkClicked(org.apache.wicket.ajax.AjaxRequestTarget
target,
javax.swing.tree.TreeNode node){
   
MyTreeNode nd = (MyTreeNode)node;
//nd.add(new DefaultMutableTreeNode(sample));
System.out.println(node + Ajax Clicked);
nd.insert(new MyTreeNode(node + child), 0);
   
//this.modelChanged();
//this.nodeExpanded(node);
this.updateTree();
   
   
}

Why it is happening like.



Thanks
Karthic


-- 
View this message in context: 
http://www.nabble.com/Problem-with-dynamic-insertion-to-Tree-tp21474815p21475834.html
Sent from the Wicket - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org