     	var changedSelection:Boolean = false;
     	
         super.commitProperties();
+        
+        if (dataProviderChanged)
+        {
+            dataProviderChanged = false;
+            doingWholesaleChanges = false;
+    	
+    	    // TODO: should resetting the dataProvider clear out all of its state?
+    	    // or should we preserve selectedIndex
+        	if (selectedIndex >= 0 && dataProvider && selectedIndex < dataProvider.length)
+        	   itemSelected(dataProvider.getItemAt(selectedIndex), true);
+        	else
+        	   selectedIndex = -1;
+        }
             
         if (requiresSelectionChanged)
         {

        }
    }
    
    /**
     *  @private
     */
    private function dataProviderChangingHandler(event:FlexEvent):void
    {
        if (dataProvider)
            dataProvider.removeEventListener(CollectionEvent.COLLECTION_CHANGE, collectionChangeHandler);
        
    	doingWholesaleChanges = true;
    }
    
    /**
     *  @private
     */
    private function dataProviderChangedHandler(event:FlexEvent):void
    {
    	doingWholesaleChanges = false;
    	
    	if (selectedIndex >= 0 && dataProvider && selectedIndex < dataProvider.length)
    	   itemSelected(dataProvider.getItemAt(selectedIndex), true);
    	else
    	   selectedIndex = -1;
    	   
    	if (dataProvider)
    	    dataProvider.addEventListener(CollectionEvent.COLLECTION_CHANGE, collectionChangeHandler);
    }
    
    protected function collectionChangeHandler(event:Event):void
    {
        if (event is CollectionEvent)

import flex.events.FlexEvent;
import flex.events.ItemExistenceChangedEvent;

import mx.collections.IList;
import mx.events.IndexChangedEvent;
import mx.events.CollectionEvent;
import mx.events.CollectionEventKind;
