Hi,
Any sample of building Accordion on an xml data? Something like a tree
> control.
>
As Tracy says, using Repeater is a simple way. Here's an example (already
within an Accordion, not shown here):
<mx:Repeater id="accRepeater" dataProvider="{ accData.mainNode }" >
<mx:Canvas label="[EMAIL PROTECTED]" width="100%"
height="100%" >
<mx:Tree dataProvider="{accRepeater.currentItem.node}"
labelField="@label"
width="200" height="100%"
creationComplete="selectFirstChild(event)"
change="handleTreeSelection(event)" />
</mx:Canvas>
</mx:Repeater>
The XML element has an id of "accData." The repeater has a dataProvider of
"accData.mainNode," "mainNode" being the top-level element in my XML
hierarchy (aside from "root").
The Repeater repeats instances of Canvas to creat the Accordion sections,
using a label of "[EMAIL PROTECTED]" for the Accordion element
headers. Within each Canvas, the Tree element uses the next level in the XML
(accRepeater.currentItem.node) as the dataprovider. The rest of the Tree
elements just fall from there.
--
Thanks,
Tom
Tom McNeer
MediumCool
http://www.mediumcool.com
1735 Johnson Road NE
Atlanta, GA 30306
404.589.0560