RE: [flexcoders] Re: Treeview - On demand updating of child nodes.

2007-11-06 Thread Tracy Spratt
setChildren() takes an XMLList, not an XMLListCollection. Fix that
first.

 

Then, in handleGetChildren(), after the above call,
trace(accountsData.toXMLString()) to make sure you are building the xml
you expect.

 

Tracy

 



From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On
Behalf Of real_yoni
Sent: Tuesday, November 06, 2007 4:39 AM
To: flexcoders@yahoogroups.com
Subject: [flexcoders] Re: Treeview - On demand updating of child nodes.

 

The tree defenition:

mx:Tree id=accountTree height=100% width=100% 
dataProvider={accountsData} labelField=@name 
iconFunction=treeIcon itemClick=onItemClicked(event); 
/mx:Tree

Upon loading I'm calling this fuction that works great:

private function handleGetAccounts(result:XML): Boolean 
{
accountsData = new XMLListCollection(result.act);
return true; 
}

Upon clicking on an item I'm calling this function which doesn't work

private function handleGetChildren(result:XML): Boolean 
{
if (accountTree.selectedItem != null) 
{ 
accountTree.selectedItem.setChildren(new 
XMLListCollection(result.act))

accountTree.expandItem(accountTree.selectedItem,true,true);
}
return true; 
}

*** The handle messages are being called after the async call of 
HTTPSerivce has return

 



RE: [flexcoders] Re: Treeview - On demand updating of child nodes.

2007-11-05 Thread Tracy Spratt
Actually the doc is incorrect there. The XML api DOES dispatch the
necessary events to update the tree.

 

And if you are seeing the raw xml node then clearly this is not your
issue.

 

Post a bit of the xml, and the Tree tag declaration.

 

Tracy

 



From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On
Behalf Of real_yoni
Sent: Monday, November 05, 2007 3:01 PM
To: flexcoders@yahoogroups.com
Subject: [flexcoders] Re: Treeview - On demand updating of child nodes.

 

Thanks, but that is not the case... I'm using an attribute by the 
name of name.

However I did find this link : 
http://livedocs.adobe.com/flex/201/html/wwhelp/wwhimpl/common/html/ww
http://livedocs.adobe.com/flex/201/html/wwhelp/wwhimpl/common/html/ww 
help.htm?
context=LiveDocs_Book_Partsfile=about_dataproviders_057_16.html

And in it there is this remark:
Remember that the Tree will not, by default, reflect dynamic 
changes to the XML object. 

so how can i change the default???

--- In flexcoders@yahoogroups.com mailto:flexcoders%40yahoogroups.com
, Tracy Spratt [EMAIL PROTECTED] 
wrote:

 The child nodes you add must have the attribute that you are using 
for
 the label. Or use a labelFunction(). Seeing the raw data usually 
means
 the tree does not know what to use for the label.
 
 Tracy
 
 
 
 
 
 From: flexcoders@yahoogroups.com mailto:flexcoders%40yahoogroups.com

[mailto:flexcoders@yahoogroups.com mailto:flexcoders%40yahoogroups.com
] On
 Behalf Of real_yoni
 Sent: Monday, November 05, 2007 1:30 PM
 To: flexcoders@yahoogroups.com mailto:flexcoders%40yahoogroups.com 
 Subject: [flexcoders] Treeview - On demand updating of child nodes.
 
 
 
 Hi, 
 
 I'm trying to update a tree upon an on click event (so that when a 
 user clicks on a node it access the server and fetch the child 
nodes). 
 My problem is that when expanding the node I see the raw XML.. 
does 
 any one knows how to reflect the changes?
 
 Thanks,
 Yoni.