I'm using Flashbuilder for this. I have a button that changes the id of a dataProvider like this:
result.datagrid.dataProvider="lineup_1";
However, I have another button which should also change the id of the dataprovider when clicked on, but to this:
result.datagrid.dataProvider="lineup_2";
However, it only responds to the first button pressed on. After that, the id stays the same, which is logic. But I need to know how I can change the id after a button is pressed too.
If you say
result.datagrid.dataProvider="lineup_1";
you do not change dataProvider's id, you change the dataProvider. So at both actions, you change the dataProvider.
More on this, I think you need to make a refresh o your dataprovider after changing. Something like :
(result.datagrid.dataProvider as ICollectionView).refresh();