Binding Selected Items in a Flex List
Just a quickie.
Discovered today that if you try to programatically deselect the currently selected item in a ListBase subclass with selectedItem=null the change doesn't propagate to anything bound to {my_list.selectedItem}. In fact in my application it seems to permanently break the data binding.
Instead, to deselect a list item, do selectedIndex=-1, that seems to work.
So I've got something like:
<mx:Button label="Clear" click="entries.selectedIndex=-1"/>
<mx:List id="entries" dataProvider="{my_data}"/>
<components:MyEntryDisplay entry="{entries.selectedItem}"/>
which is fine for me.