File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

getting a selected node in a tree

 
Rohit Rai
Ranch Hand
Posts: 53
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi!
I have a sample tree created using the following code.

<s:tree theme="ajax" id="root" label="TestTracking" showGrid="true">
<s:treenode theme="ajax" id="child2" value="2" label="<b>Project 2</b>" />
<s:treenode theme="ajax" id="child3" value="3" label="<b>Project 3</b>" />
</s:tree>

Now on click of a node I would like to alert some message e.g.

<s:treenode theme="ajax" id="child2" value="2" onClick="alert('i am here')" label="<b>Project 2</b>" />

But it is not working. Am i doing something wrong?

Thanks for any help,
Regards
 
Sagar Rohankar
Ranch Hand
Posts: 2905
1
Java Spring Ubuntu
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Rohit Rai wrote:

Now on click of a node I would like to alert some message e.g.

<s:treenode theme="ajax" id="child2" value="2" onClick="alert('i am here')" label="<b>Project 2</b>" />

But it is not working. Am i doing something wrong?



Not used Struts 2, but I don't think there is an attribute "onClick()" , with C capital.. make it small, like "onclick(..)". For reference, I looked this.
 
David Newton
Author
Rancher
Posts: 12617
IntelliJ IDE Ruby
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
When interacting with Dojo controls it's probably best to use the Dojo event handlers; see the Dojo documentation for details (and recall that S2 is using a rather old version of Dojo, 0.4.x if I remember correctly).
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic