Setting the 'selectedItem' twice works around this flex tree bug.
To: [email protected]
From: [email protected]
Date: Fri, 30 Dec 2011 19:14:19 +0000
Subject: [flexcoders] Flex Tree selectedItem is null issue
This works, and tree.selectedItem is not null after assignment:
var nodeToSelect:XML = this.tree.dataProvider.getItemAt(0) as XML;
this.tree.expandItem(nodeToSelect, true);
this.tree.selectedItem = nodeToSelect; // NOT NULL
But this doesn't, when the tree 'selectedItem' is set to an xml sub node:
var node:XML = this.tree.dataProvider.getItemAt(0) as XML;
var nodeToSelect:XML = node.children()[0]; // valid value
this.tree.expandItem(n2, true);
this.tree.selectedItem = nodeToSelect; // NULL
How can I fix this?
Cheers.