I am using a combobox to list the contents of a folder.
With a button click I use that combobox.selectedItem to delete that folder. After I delete the data is still in the combobox. How do I go about refreshing that combobox?
ArrayLists and ArrayCollections (whichever you use as a 'dataProvider') both dispatch CollectionEvent.COLLECTION_CHANGE events to notify the List component (or CombBox in this case) that an item was added or removed.
So basically all you need to do, is removing the item from the dataProvider and the ComboBox will refresh automatically.
myComboBox.dataProvider.removeItemAt(myComboBox.selectedIndex);
(for this example code I'm assuming you're talking about a Spark ComboBox which only takes ILists as a dataProvider)
selectedIndex = -1
RIAstar 2012-04-05 16:11