I have component with Trees and I'm moving elements from one to another. I store data in dataProvider as XMLList with labelFiled="name" and itemRenderer as class, which expends one (thanks to that nodes and elements have checkboxes). I enabled moving mechanism between Trees just by enabling Tree's properties (dragEnabled="true" dragMoveEnabled="true" dropEnabled="true").
Problem occurs when I try to get data from dataProvider, which has only elements. To get data I use command:
[CODE]var xmlSource:String = new XMLList(this.treeDest.dataProvider).toString();[/CODE]
If dataProvider has some nodes or some elements and nodes, its fine. But when data has only elements, I've got empty strings.
I've tried to change command, but it has changed nothing or made it even worse. I also thought about namespaces in elements, that they mix up something, but it was dead end.
Any ideas? I'ld apprecieate any of thoughts about this.
Try using toXMLString() instead of toString()
Well, effect was pretty the same, but I've found an answer. I just shouldnt get data by refering to dataProvider from Tree. Instead, I have var, that stores all Tree data (and is referenced in dataProvider) and if I want to get or set data, I just refer to that var, insterad of whole dataProvider thing.