Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Problem in giving action on tree created using <s:tree> tag

 
sunny choudhary
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I am facing problem in giving action when I click on any node of the tree.
This tree is created using Struts2 <s:tree> and <s:treenode> tags.
Any pointers regarding this will be helpful.


Best Regards,
Sunny
 
sunny choudhary
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello,

Sorry for not providing the problem in detail.

I am creating a tree structure using the Struts2 tags <s:tree> and <s:treenode>.
I have written the following code for the same -

<s:tree theme="ajax" id="monitorTree" label="CCMS Monitors" >
<c:forEach var="monitor" items="${sessionScope.monitorNamesList }">
<s:treenode theme="ajax" label="${monitor }"></s:treenode>
</c:forEach>
</s:tree>

monitorNamesList is the list of monitor names that i have to display as tree nodes.
The tree is created successfully but my requirement id to give an action if I click on any node of the tree.

I am not finding the solution on how to invoke an action on click of any tree node.
Any help regarding this will be appreciated.


Thanks and Regards,
Sunny
 
David Newton
Author
Rancher
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Have you read the tag docs for the tree tags? I think tree takes a "selectedNotifyTopics" (or something like that, I don't remember) that specifies the topic to be published on node selection.

Note that the wiki docs for S2.0.x tags are found in the S2.0.11 docs--anything above that is for S2.1. Note also that the Dojo-based tags are deprecated as of S2.1.6 because of the ancient version of Dojo they use.
 
sunny choudhary
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

Thanks for replying.

Tree takes one parameter treeSelectedTopic. Is this the parameter that you were talking about.
The details about this parameter is not given. Also I am not able to find any example on it.

If you can provide some exapmle on it or how to use this parameter then it would be very helpful.
I am new to Struts and I am finding difficulty in doing so.


Regards,
Sunny
 
David Newton
Author
Rancher
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Maybe there's an example in showcase; I don't recall. In any case, there are other examples for Dojo's topics for other tags--I'd assume this one works the same way.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic