You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by PSkarthic <ka...@touchpointindia.com> on 2009/01/12 09:41:06 UTC

Wicket tree

Hi 
  I have constructed my tree but i cant get the clicked node.
The nodeLinkClicked() function is not working.
I used the nodeLinkClicked method in two ways

 1. exetending Tree class
 2. while creating the object new(){ nodeLinkClicked() };

In both i just put standard output statement but that doesn't get called.
-- 
View this message in context: http://www.nabble.com/Wicket-tree-tp21410500p21410500.html
Sent from the Wicket - User mailing list archive at Nabble.com.


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


Re: Wicket tree

Posted by vela <ve...@gmail.com>.
Hello,


I am facing the same issue.
I can't able to get the selected node by this implemenation. 

I have the code like this 

TreeModel t = createTreeModel();

        tree = new Tree("tree", t) {
                    protected void onNodeLinkClicked(TreeNode node,
AjaxRequestTarget target) {
                        final TreeNode m_node = node;
                        
                        System.out.println("selected value  "+
node.toString());
                      }

               };



If you know what the problem is, Kindly let me know.






PSkarthic wrote:
> 
> Thank you its worked :jumping:, what i did wrong was i override the tree
> onNodeLinkClicked method 
> 
> 
> 
> 
> Newgro wrote:
>> 
>> AFAIK you can use Tree. It's extending already the DefaultAbstractTree.
>> Cheers
>> Per
>> 
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
>> For additional commands, e-mail: users-help@wicket.apache.org
>> 
>> 
>> 
> 
> 

-- 
View this message in context: http://www.nabble.com/Wicket-tree-tp21410500p23273139.html
Sent from the Wicket - User mailing list archive at Nabble.com.


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


Re: Wicket tree

Posted by PSkarthic <ka...@touchpointindia.com>.
I have a new 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/Wicket-tree-tp21410500p21472531.html
Sent from the Wicket - User mailing list archive at Nabble.com.


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


Re: Wicket tree

Posted by PSkarthic <ka...@touchpointindia.com>.
Thank you its worked :jumping:, what i did wrong was i override the tree
onNodeLinkClicked method 




Newgro wrote:
> 
> AFAIK you can use Tree. It's extending already the DefaultAbstractTree.
> Cheers
> Per
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
> 
> 
> 

-- 
View this message in context: http://www.nabble.com/Wicket-tree-tp21410500p21431002.html
Sent from the Wicket - User mailing list archive at Nabble.com.


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


Re: Wicket tree

Posted by Per Newgro <pe...@gmx.ch>.
AFAIK you can use Tree. It's extending already the DefaultAbstractTree.
Cheers
Per

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


Re: Wicket tree

Posted by PSkarthic <ka...@touchpointindia.com>.
Thank you  for your reply.

 So i have to extend the DefaultAbstractTree and override the 
onNodeLinkClicked is that right?
   I am trying that.

Newgro wrote:
> 
> Hi,
> 
> a bit more code would help getting a good answer.
> 
> You could overwrite the 
> DefaultAbstractTree.onNodeLinkClicked(AjaxRequestTarget target, TreeNode 
> node) method. Why this should not work - i only can hit the air.
> Another way is to call the 
> AbstractTree.getTreeState()..isNodeSelected(pNode) or 
> getSelectedNodes(). But this will not give you the clicked but the 
> selected nodes.
> 
> PS: Based on Wicket 1.3.5
> 
> HTH (at least a bit)
> 
> Per
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
> 
> 
> 

-- 
View this message in context: http://www.nabble.com/Wicket-tree-tp21410500p21430564.html
Sent from the Wicket - User mailing list archive at Nabble.com.


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


Re: Wicket tree

Posted by Per Newgro <pe...@gmx.ch>.
Hi,

a bit more code would help getting a good answer.

You could overwrite the 
DefaultAbstractTree.onNodeLinkClicked(AjaxRequestTarget target, TreeNode 
node) method. Why this should not work - i only can hit the air.
Another way is to call the 
AbstractTree.getTreeState()..isNodeSelected(pNode) or 
getSelectedNodes(). But this will not give you the clicked but the 
selected nodes.

PS: Based on Wicket 1.3.5

HTH (at least a bit)

Per

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


Re: Wicket tree

Posted by PSkarthic <ka...@touchpointindia.com>.
Is There any one to solve this 

Hi 
  I have constructed my tree but i cant get the clicked node.
The nodeLinkClicked() function is not working.
I used the nodeLinkClicked method in two ways

 1. exetending Tree class
 2. while creating the object new(){ nodeLinkClicked() };

In both i just put standard output statement but that doesn't get called.


-- 
View this message in context: http://www.nabble.com/Wicket-tree-tp21410500p21428684.html
Sent from the Wicket - User mailing list archive at Nabble.com.


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