struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Dave Newton <newton.d...@yahoo.com>
Subject Re: unable to capture events with <s:tree>
Date Mon, 02 Apr 2007 09:34:12 GMT
--- Manu Mahajan <manu@comprointertech.com> wrote:
> Do I have to use some dojo specific code here?

I've been using the Dojo binding stuff; my sample is
from a pretty long time ago now but here it is in case
it helps. It might just make things worse ;)

The Javascript:

function treeNodeSelected(nodeId) {
  alert("nodeId = " + nodeId);
  /* Normally I'm doing some Ajax on a select; I left
   * it here so you could see one way if you want.
  dojo.io.bind({
      url: "<s:url action='foo/bar'/>",
      load: function(type, data, evt) {
          var displayDiv = dojo.byId("displayId");
          displayDiv.innerHTML = data;
      },
      mimeType: "text/html"
  });
  */
};

// arg1: topic named in <s:tree.../>
// arg2: not sure; don't remember
// arg3: name of JavaScript handler.
dojo.event.topic.subscribe("treeSelected", this,
"treeNodeSelected");

The JSP:

<s:tree theme="ajax"
        rootNode="%{rootNode}"
        childCollectionProperty="children"
        nodeIdProperty="id"
        nodeTitleProperty="name"
        treeSelectedTopic="treeSelected"
        toggle="explode"
        toggleDuration="0"
        cssClass="bptree"
        id="bptree">

I'll add this or something similar to the Wiki at some
point, and I fixed the snippets that were giving an
error.

Question about snippets: is there a way to make them
render properly?

d.



 
____________________________________________________________________________________
It's here! Your new message!  
Get new email alerts with the free Yahoo! Toolbar.
http://tools.search.yahoo.com/toolbar/features/mail/

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Mime
View raw message