PDA

View Full Version : Sorting an XMLListCollection is not updating the dataprovider


Flexer
05-16-2007, 06:50 AM
Hi,

I need some help please, I am using a tree that is binded to XML (not xmlcollection).

I am using the library XPathQuery which is pretty cool.

xmlCurrentList contains my XML and is binded to the tree dataprovider


var nodeList:XMLList = XPathQuery.execQuery(xmlCurrentList, "/List//Profile[@ProfileId=" + Id + "]/../*");

var xlcList:XMLListCollection = new XMLListCollection(nodeList);

sortXMLCollection (xlcList, "@Sequence");

xlcList.refresh();


All this works but after the xlcList is sorted based on my sequence field, the change is not reflected on the tree!

I need somehow to make the nodeList equal to the new sorted list !

some help please.

Thanks

Flexer
05-16-2007, 07:40 AM
I have tried the following, this makes the nodeList equal to the new sorted list but still it does not reflect the change on the freakin dataprovider.

for(var i:int=0;i < xlcList.length; i++)
{
nodeList[i] = xlcList[i];
}

what is going on !!

vdatiger
05-17-2007, 11:17 AM
- Did you put [Bindable] in front of variable ?
- If still can not then you can use ChangeWatcher