I'm under the impression that the selected topic publishing isn't currently working in Struts 2. At least the examples in the showcase app aren't working for me (in Firefox 2.0.0.6). When I had to do something similar I found this: http://issues.apache.org/struts/browse/WW-1813?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
It says that it's fixed in 2.1.0, but since that isn't released yet, I just decided to implement the tree using YUI and writing all the javascript parts manually (it isn't very hard anyway). On 8/6/07, Session A Mwamufiya <[EMAIL PROTECTED]> wrote: > > Hi again, > > Anyone has a clue about obtaining a user's selection in an s:tree > element? I used the example from the showcase, and I don't fully understand > the following script: > > <script> > function treeNodeSelected(nodeId) { > dojo.io.bind({ > url: "<s:url value='dynamicTreeSelectAction.action' > />?nodeId="+nodeId, > load: function(type, data, evt) { > var displayDiv = dojo.byId("displayId"); > displayDiv.innerHTML = data; > }, > mimeType: "text/html" > }); > }; > > dojo.event.topic.subscribe("treeSelected", this, "treeNodeSelected"); > </script> > > I put in logging inside every method of my dynamicTreeSelectAction action, > but nothing gets logged, so I gather that the node selection is not properly > handled. Can someone explain to me what is going on in this script and why > my action is never being called. > > If you need to see the s:tree declaration, here it is: > <td width="90%" valign="top"> > <div style="margin-right: 50px;"> > <s:tree > theme="ajax" > rootNode="%{treeRootNode}" > childCollectionProperty="childrenNodes" > nodeIdProperty="id" > nodeTitleProperty="name" > treeSelectedTopic="treeSelected"> > </s:tree> > </div> > > <div id="displayId"></div> > </td> > > There used to be some instruction text between the <div > id="displayId"></div> tag, but I removed it. There's a reference to this > div in the script above, but I don't know how it's being used. > > Any help would be truly appreciated. > > Best, > Session > > > > Hi, > > > > I was able to get the selected item from a s:select element, which can > be > > accessed from the property variable that is associated with it. Now I'm > > trying to do the same with the s:tree element. But it seems as though > > there is no property object association with s:tree. How would I go > > about getting a user's tree node selection from code? > > > > Thanks, Session > > > > > > --------------------------------------------------------------------- To > > unsubscribe, e-mail: [EMAIL PROTECTED] For additional > > commands, e-mail: [EMAIL PROTECTED] > > > > > > > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > >