Sorry about the link that came in because I copy pasted text from the
web page and thunderbird copied the hyperlink as well. Please ignore the
link. I assume you have got the correct tree.ftl file.
Please note that the parameter passed to the javascript callback
function will not be the "nodeId" but it will be a dojo "message" object.
try replacing the following code
function treeNodeSelected(nodeId)
{
dojo.byId("id_group").value = nodeId;
}
with
function treeNodeSelected(message)
{
dojo.byId("id_group").value = message.node.widgetId;
}
GEDA wrote:
I did download the tree.ftl file from the file attachement but still doesn't
work. The link you gave me is not an actual file but a diff file which I
don't know how to use it. :(
Manu Mahajan-2 wrote:
Hi
Try this. Create a directory template/ajax in your application and copy
the file tree.ftl from this page
https://issues.apache.org/struts/browse/WW-1813?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
You can search for this string
"/struts/struts2/trunk/plugins/dojo/src/main/resources/template/ajax/tree.ftl
<http://svn.apache.org/viewcvs.cgi//struts/struts2/trunk/plugins/dojo/src/main/resources/template/ajax/tree.ftl/?rev=528866&view=diff&r1=528866&r2=528865&p1=/struts/struts2/trunk/plugins/dojo/src/main/resources/template/ajax/tree.ftl&p2=/struts/struts2/trunk/plugins/dojo/src/main/resources/template/ajax/tree.ftl>"
(You'll find a link to the file modified on 14th Apr)
Your code should work now. I just tested this with a standard 2.0.8
showcase app.
Manu
GEDA wrote:
Is there a workaround in order for this to work ?
<s:tree theme="ajax"
rootNode="%{groupTreeModel}"
childCollectionProperty="children"
nodeIdProperty="id"
nodeTitleProperty="name"
treeSelectedTopic="treeSelected">
</s:tree>
function treeNodeSelected(nodeId) {
dojo.byId("id_group").value = nodeId;
};
dojo.event.topic.subscribe("treeSelected", this,
"treeNodeSelected");
</script>
Thank you.
---------------------------------------------------------------------
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]