PDA

View Full Version : When is a Tree done redrawing?


saltzmanjoelh
06-20-2009, 11:52 PM
I am trying to perform a function when a tree is done redrawing. Is there an event that gets dispatched when this happens?

The tree's dataProvider is an ArrayCollection of Objects. Each Object has a children property that is an ArrayCollection. I want to add a new Object to the children collection then set the Tree.selectedItem to the new item. If I do it too soon the item doesnt have an itemRenderer drawn. Is there an event that is dispatched after the tree redraws everything? Maybe after the invalidateDisplayList() function?

Peter Cowling
06-23-2009, 04:20 PM
I think that Tree is flakey, so someting like callLater probably will be no use. i.e. I think it is less a matter of waiting for something to finish, and more a matter of giving Tree a hand.

Adobe (per the source code for Tree) likes validateNow().

Possibly working off updateCompletePendingFlag == true is another option.