I use the Change attribute:
<mx:Tree
width="100%" height="100%"
id="employeeTree"
dataProvider="{treeHttpSrv.result}"
change="onClick(employeeTree);"/>
I hope this helps somewhat :-)
Regards,
Graham Weldon.
Alin DICU wrote:
Hi,
I'm having problemes accessing clicked branches in trees. I tried many
thing but I keep stumbling on undefined items.
Here are piéces of my code:
------------------------------------- the UI tree component
-------------------------------
<mx:Tree id="employeeTree" dataProvider="{treeHttpSrv.result}"
width="100%" nodeOpen="dataController.onTreeClick(employeeTree)"
height="100%"/>
----------------------------------- the httpservice which works
----------------------------
<mx:HTTPService
id="treeHttpSrv"
concurrency="multiple"
method="GET"
url=""http://localhost:8084/FlexXMLServer/XMLTreeElementsServlet">http://localhost:8084/FlexXMLServer/XMLTreeElementsServlet"
showBusyCursor="true"
fault="alert(event.fault.faultstring);"/>
--------------------------------- the format of the XML object send by
the servlet---------
<Albums>
<label>Albums</label>
<nomAlbum>
<label>BMW</label>
<nomPhoto>
<label>BMW 325ci 1994</label>
<urlPhoto>http://localhost:8080/FlexXMLServer/Photos/BMW/BMW
325ci 1994.jpeg</urlPhoto>
</nomPhoto>
</nomAlbum>
</Albums>
------------------------------- the DataController function
-------------------------------
public function onTreeClick(event):Void
{
trace(event.selectedItem);
}
It seems I can't get a proper handler on the tree so I can extract the
urlPhoto attriburte from the xml.
Could someone please redirect me to some working examples or give some
tips?
Thank,
--
Flexcoders Mailing List
FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com
SPONSORED LINKS
YAHOO! GROUPS LINKS
|
- Re: [flexcoders] difficulties accessing tree branches Graham Weldon
-