struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Manu Mahajan <>
Subject Re: unable to capture events with <s:tree>
Date Tue, 03 Apr 2007 10:00:16 GMT
Hi Dave,

If your code is working then can you please check what version of struts 
you are using because it's not working for me. I am using 

I tried to investigate the problem a bit and here's the result of my effort.

I downloaded the dojo toolkit from the official website and went through 
some samples. Here is what I found

Code generated by struts2
<div dojoType="Tree"  id="contentTree" 

This is not working for me.

Code from Dojo sample
<dojo:TreeSelector widgetId="treeSelector" 
<div dojoType="Tree" id="contentTree" selector="treeSelector">

This is working.

I think the <dojo:TreeSelector> is required for the tree to notify 
select events. and the selector parameter in the tree connects the tree 
and the selector.

Since the <s:tree> tag does not support the selector parameter I 
modified struts code to allow a parameter named "treeSelector" in this tag
I made changes to the following files in the struts-core jar

The modified files are attached with the mail as a .zip file in case 
somebody else wants to use/review them.(I had to zip them because I 
thought it might be rude to send 400KB of attachments)

So my jsp now looks like

<s:head debug="true" theme="ajax"/>
<script language="JavaScript" type="text/javascript">
dojo.addOnLoad(function() {
             function(message) { dojo.debug(message.node.title+" 
selected"); }

<dojo:TreeSelector widgetId="treeSelector" 
<s:tree id="contentTree"
        theme = "ajax"

This is working perfectly for me but I think the solution would not be 
complete till we have a <s:treeSelector> tag in the tag lib.

Please suggest if I'm on the right track and if this could be 
incorporated in the struts code and what is the formal way to suggest 
this to the developers.

Manu  Mahajan

Dave Newton wrote:
> --- Manu Mahajan <> wrote:
>> I'm using Tomcat 5.5
> The code I posted is working for me; can you post your
> current code? (Personally I won't have access to my
> code until this evening, but maybe somebody else can
> help.)
> d.
> ____________________________________________________________________________________
> It's here! Your new message!  
> Get new email alerts with the free Yahoo! Toolbar.
> ---------------------------------------------------------------------
> To unsubscribe, e-mail:
> For additional commands, e-mail:

View raw message