I have a Tree Object in my Flex Application that uses an
XMLListCollection from a WebService call as the Data Provider. I am
trying to programmatically open specific nodes, and select specific
items in the Tree, but I am having no success.
Basically, I have a set of saved items - parameters - that
should be selected by default when the Tree is displayed, and I
want the parent nodes of those selected items to be opened, so the
user can see them as selected.
See my code below. I have debugged this, and I have verified
that the code in the deepest if statement IS being triggered, but
the expandItem() method is doing nothing, and the selectedItems
Array is also not being updated.
The main problems is probably due to creating an XMLDocument
. You've essentially copied the dataprovider, so the nodes you are
offering as selected items are clones of, but not identical to, the
items in the data provider. We match identitiy and not
ExpandItem also requires that all nodes above it have been