I'm using an array to populate a DataProvider, which I'm using to populate a list component. Like this:
var myDataProvider = new DataProvider(this.myArray);
this['list'].dataProvider = myDataProvider;
When changes are made to the array, I want to tell the DataProvider to update so that those changes will be reflected in the list component. It would be nice if there was a way to tell the DataProvider to listen for changes in the array and update itself, but I would settle for a way to manually update it.
I can replace the DataProvider with a new DataProvider, but then the list loses its selection. I suppose I could go through the DataProvider and compare and modify every entry to make it match the array, but this seems way too cumbersome. Is there any way to tell a DataProvider to update to match an array?
Edit: I'm looking for a way to do this in Flash, not Flex.