With the final release of Flex 2, you now need to add a root XML node to your data... it can be anything, it just has to be there...
 
 
<somekindofroot>
    <node label="One item with subitem">
        <node label="Subitem"/>
    </node>
</somekindofroot>
 
and
 
<somekindofroot>
    <node label="One Item Only"/>
</somekindofroot>
 
Shan


From: [email protected] [mailto:[EMAIL PROTECTED] On Behalf Of Rick Root
Sent: Wednesday, August 09, 2006 3:18 PM
To: [email protected]
Subject: [Junk E-Mail - LOW] Re: [flexcoders] accessing item data in an XMLList

ping... 7 hours later I haven't come up with a solution.. anyone?

I suppose I could send the whole XMLList object to coldfusion as a
string and have Coldfusion parse it, but that seems like an unnecessary
use of network bandwidth when all I really want are the labels compiled
into an array and sent.

Rick

Rick Root wrote:
>
> So far, I've been unable to find examples of using a tree control and
> sending its data to a web service, remote object, etc. Lots of example
> code on using the tree control, enabling drag and drop, putting
> different kidns of data INTO the tree control- but nothing about getting
> the data out of it.
>
> My tree control is driven by an XMLList object. What i'd like to do is
> get an array of all the labels for each node, but I'm not having any luck.
>
> Here are my sample XMLList objects:
>
> <mx:XMLList id="treeData1">
> <node label="One item with subitem">
> <node label="Subitem"/>
> </node>
> </mx:XMLList>
> <mx:XMLList id="treeData2">
> <node label="One Item Only"/>
> </mx:XMLList>
>
> and here is my function that shows me the items in the tree:
>
> private function showList(list):void
> {
> var item:XML;
> txtResults.text = '';
> for each(item in list)
> {
> txtResults.text += "item: " + item.attribute('label') + '\n';
> if (item.elements().length() > 0)
> {
> showList(item.children());
> }
> }
> }
>
> Unfortunately, it doesn't seem to return the label on the root node.
>
> I've also tried adding the following line above the for loop to no avail:
>
> txtResults += list.attribute('label');
>
> Can someone point me in the right direction?


--
No virus found in this incoming message.
Checked by AVG Free Edition.
Version: 7.1.405 / Virus Database: 268.10.8/414 - Release Date: 8/9/2006

__._,_.___

--
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
Web site design development Computer software development Software design and development
Macromedia flex Software development best practice


YAHOO! GROUPS LINKS




__,_._,___

--
No virus found in this outgoing message.
Checked by AVG Free Edition.
Version: 7.1.405 / Virus Database: 268.10.8/414 - Release Date: 8/9/2006

Reply via email to