It seems I validated everything but what is needed : the properties.
To make it work, I replaced :
When I was stucked in an infinite loop in setSelectionDataLoop, I noticed the dataProviderChanged flag was true. If I validate the properties before I set the selectedItem then it works fine.
Thanks, you saved my day!
Thanks for this, I have the same problem. Hopefully this workaround fixes it.
I have the exact same problem but tree.validateProperties() has not fixed the problem!
Indeed, for me neither. What I then did was use selectedIndex instead of selectedItem and that seemed to help.
hm I ll give it a go and let you know!
selectedIndex worked for me! Thank you so much Wim!
If selectedItem did not work, it may remain an inconsistence between the dataProvider and what is displayed :
If you use selectedIndex you may have a wrong behaviour, for example :
you add an item to the dataProvider, and set selectedIndex to "dataProvider.length -1" but the view is not ready for the new dataprovider and does not know any item at this index.
I'm using callLater so I don't think I will have any inconsistencies. I may be wrong though.
In Flex 3.2 selectedItem = item worked. So it might be a Flex 3.* where * > 2 or a Flex 4 bug.