Thanks Matt, I kept trying last night and this also works:
// Import the TreeNode.
import mx.controls.treeclasses.TreeNode;
// Create a data provider variable.
var treeDP;
function resultHandler(result)
{
var XMLStr:XML;
treeDP = new TreeNode();
XMLStr = new XML(result);
treeDP=XMLStr.firstChild.childNodes;
}
<mx:Tree labelFunction="lblFuncCode" dataProvider="{treeDP}" >
</mx:Tree>
"Matt Chotin" To: [email protected]
<[EMAIL PROTECTED]> cc:
Sent by: Subject: RE: [flexcoders] XML
as dataprovider : Changes to
[email protected] unknown property, childNodes,
will not be detected.
08/02/2005 10:41 PM
Please respond to
flexcoders
You basically can write a quick function as a workaround:
function getChildNodes(xml):Array
{
return xml.firstChild.childNodes;
}
dataProvider="{getChildNodes(XMLStr)}"
Matt
From: [email protected] [mailto:[EMAIL PROTECTED] On
Behalf Of [EMAIL PROTECTED]
Sent: Tuesday, August 02, 2005 2:23 PM
To: [email protected]
Subject: [flexcoders] XML as dataprovider : Changes to unknown property,
childNodes, will not be detected.
I am using a Remote object that returns a string in a XML format, and
converting this string to XML by using
XMLStr = new XML(Str)
I then use XMLStr as dataProvider in a Tree.
<mx:Tree labelFunction="lblFuncCode"
dataProvider="{XMLStr.firstChild.childNodes}" >
</mx:Tree>.
The results are displaying OK, but I get a warning message:
Changes to unknown property, childNodes, will not be detected
I think I understand that this means that if I change XMLStr that change
will not be reflected on my Tree. I read this data at the beginning and I
don't expect the data to change. This is mainly a look-up.
How can I avoid this warning?
---------------------------------------------------------------------------
This e-mail message (including attachments, if any) is intended for the use
of the individual or entity to which it is addressed and may contain
information that is privileged, proprietary , confidential and exempt from
disclosure. If you are not the intended recipient, you are notified that
any dissemination, distribution or copying of this communication is
strictly prohibited. If you have received this communication in error,
please notify the sender and erase this e-mail message immediately.
---------------------------------------------------------------------------
--
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
Computer software Macromedia flex Development
testing
Software developer
YAHOO! GROUPS LINKS
Visit your group "flexcoders" on the web.
To unsubscribe from this group, send an email to:
[EMAIL PROTECTED]
Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.
---------------------------------------------------------------------------
This e-mail message (including attachments, if any) is intended for the use
of the individual or entity to which it is addressed and may contain
information that is privileged, proprietary , confidential and exempt from
disclosure. If you are not the intended recipient, you are notified that
any dissemination, distribution or copying of this communication is
strictly prohibited. If you have received this communication in error,
please notify the sender and erase this e-mail message immediately.
---------------------------------------------------------------------------
------------------------ Yahoo! Groups Sponsor --------------------~-->
<font face=arial size=-1><a
href="http://us.ard.yahoo.com/SIG=12hdcskrt/M=362329.6886308.7839368.1510227/D=groups/S=1705007207:TM/Y=YAHOO/EXP=1123084827/A=2894321/R=0/SIG=11dvsfulr/*http://youthnoise.com/page.php?page_id=1992
">Fair play? Video games influencing politics. Click and talk back!</a>.</font>
--------------------------------------------------------------------~->
--
Flexcoders Mailing List
FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com
Yahoo! Groups Links
<*> To visit your group on the web, go to:
http://groups.yahoo.com/group/flexcoders/
<*> To unsubscribe from this group, send an email to:
[EMAIL PROTECTED]
<*> Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/