OK, what you put is exactly what I am doing, almost word for word. When i set my dataprovider to a new ArrayCollection - the first time it works fine, then after that it works but the new data does not appear in the combobox. All the bindings appear to fire, and the new data is in the backing ArrayCollection as seen from the debugger. However, on the screen the dropdown is now empty. Hence my thought that I somehow need to create or renew a binding between the combobox and the .mxml file (the screen) that it is nested in.
I appreciate your help. Roscoe --- In [email protected], "dmiramontesval" <[EMAIL PROTECTED]> wrote: > > So if i got it right, you want a custom ComboBox on several screens > and the only thing that is going to change is the dataProvider, right? > > I would do the following: > > 1. In your custom ComboBox declare a variable like this: > > private var _myDataProvider : Array; //or ArrayCollection, as you prefer > > 2. Create a getter and setter methods > > [Bindable] > public function get myDataProvider() : Array > { > return _myDataProvider; > } > > public function set myDataProvider(dp : Array) : void > { > _myDataProvider = dp; > this.dataProvider = myDataProvider; > } > > 3. In the application where you want to include the custom ComboBox, > pass the dataProvider you want to use, like this: > > <custom:CustomComboBox myDataProvider="{DataProviderYouWantToUse}"/> > > or > > var myCustomCB : CustomComboBox > myCustomCB.myDataProvider = DataProviderYouWantToUse > > > > Please consider that "DataProviderYouWantToUse" is the array (or > arrayCollection) that you want to use as dataProvider for your > ComboBox. When setting the myDataProvider, the setter will be called > and the dataProvider will be updated. > > Hope this helps you out > > --- In [email protected], "Roscoe P Coltrane" > <roscoe75028@> wrote: > > > > Using Flex 2 - > > I have extended ComboBox in an AS3 class. My plan is to use it a lot > > in several places and just programatically change the dataProvider in > > each of the places. It works as expected the first time I use it in a > > generated screen. Later I remove the screen, then still later I > > recreate the screen containing the combobox. This time the > > dataProvider still gets updated, but now no data is visible in the > > dropdown on the screen - it appears empty. I figure it needs to be > > rebound to the screen somehow, since I have verified I have data. > > However, I cannot figure out how to bind the instance of the combobox, > > and / or exactly what else in it besides the dataProvider, in such a > > way that the screen gets updated. > > Could someone give me some pointers, or at least some idea of what I > > am doing wrong? > > Thanks, > > Roscoe > > >

