-
1. Re: stuck in ListBase.setSelectionDataLoop
eprevot123 Mar 18, 2011 7:40 AM (in response to eprevot123)It seems I validated everything but what is needed : the properties.
To make it work, I replaced :
tree.invalidateList();
tree.invalidateSize();
tree.invalidateDisplayList();
tree.validateNow();with:
tree.validateProperties();
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.
-
2. Re: stuck in ListBase.setSelectionDataLoop
eugene_se Oct 16, 2011 12:13 AM (in response to eprevot123)Thanks, you saved my day!
-
3. Re: stuck in ListBase.setSelectionDataLoop
Wim Deblauwe Dec 15, 2011 8:49 AM (in response to eprevot123)Thanks for this, I have the same problem. Hopefully this workaround fixes it.
-
4. Re: stuck in ListBase.setSelectionDataLoop
kkudiksx Jan 11, 2012 6:09 AM (in response to eprevot123)I have the exact same problem but tree.validateProperties() has not fixed the problem!
-
5. Re: stuck in ListBase.setSelectionDataLoop
Wim Deblauwe Jan 11, 2012 6:20 AM (in response to kkudiksx)Indeed, for me neither. What I then did was use selectedIndex instead of selectedItem and that seemed to help.
-
6. Re: stuck in ListBase.setSelectionDataLoop
kkudiksx Jan 11, 2012 6:35 AM (in response to eprevot123)hm I ll give it a go and let you know!
-
7. Re: stuck in ListBase.setSelectionDataLoop
kkudiksx Jan 11, 2012 6:50 AM (in response to eprevot123)selectedIndex worked for me! Thank you so much Wim!
-
8. Re: stuck in ListBase.setSelectionDataLoop
eprevot123 Jan 11, 2012 7:01 AM (in response to kkudiksx)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.
-
9. Re: stuck in ListBase.setSelectionDataLoop
kkudiksx Jan 11, 2012 7:09 AM (in response to eprevot123)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.

