I think you are on track with the idea of needing an "open indices" property. But indicices are a bit messy in a tree. what would be best is a set of common unique identifiers. A field in each node that is unique. This will allow you to build a function that creates a list of the ids that are open, and another function that opens those nodes. The nodes will have the same id no matter what language the actual text of the tree item is. gathering the ids from the open items, and opening the items that have a given list of ids should be relatively straight forward.
Regards, Hank On 12/23/06, Oliver Merk <[EMAIL PROTECTED]> wrote:
I've been wrestling with this for over a week and haven't found a solution to this problem. Hoping someone can help. I have a tree control that, at runtime, changes its dataProvider. In this case, I'm switching languages and the dataProvider format is XMLListCollection. I'd like to restore the open items of the tree after the dataProvider has changed. I tried using the openItems property, but openItems stores a list of XML objects from the original dataProvider. When the provider changes, the XML objects are of course different, and trying to reset the openItems property fails. What I really need is an "openIndices" property that is not tied to the XML data in the provider. The example Adobe gives (http://www.adobe.com/devnet/flex/quickstart/working_with_tree/) is not helpful since they switch between two dataProviders with the same content and they're using an ArrayCollection (I'm using an XMLListCollection). I've tried walking the tree but since the new Flex 2 tree control limits direct access to nodes, I could not find a way to detect the open indexes of the tree directly. Any ideas? Thanks, Oliver -- 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