I have stumbled across an old fix I found for a problem I had with an mx:ComboBox ages ago and thought it worth while blogging about. Basically I found that if I bound an ArrayCollection to the dataprovider of a ComboBox and then changed the contents of the ArrayCollection, the ComboBox would not update? I tried all sorts of things i.e. itemUpdated() on the provider/collection, invalidateProperies/DisplayList on the ComboBox and so on to no avail. I originally found that setting the prompt attribute in the ComboBox caused the issue but on building a quick example application I found that with or without the prompt it still fails to update. In fact its even odder without a prompt, the selected item changes but not the content within the dropdown???
So the solution is when you change the ArrayCollection assigned as the data provider to the ComboBox then assign the collection to the list control data provider for the ComboBox using the dropdown attribute, for example:
if(fixedCB.dropdown) fixedCB.dropdown.dataProvider=value;
Here is an example I have done to highlight the issue, change the data provider using the top button and notice the following:
1) First ComboBox the selected item changes but the rest of the list does not (can be sporadic in it’s occurrence)?
2) Second ComboBox the list does not change at all?
3) The third ComboBox should now be fixed.
* Note * The faulty ComboBoxes will work if you have a selected item first!


10 Comments
I recently came across this bug. I fixed it by using the following code.
dpArrayCollection.removeAll();
dpArrayCollection.addAll( resultsArrayCollection );
Your example gives a 404 error.
Thank you, this was driving me crazy…
The 404 is now fixed @kyledodge thanks for the heads up!
Thanks, your post was very helpful, I also struggled with this bug.
————————————————————————
dpArrayCollection.removeAll();
dpArrayCollection.addAll( resultsArrayCollection );
————————————————————————
TANX MAN! IT WORKS!
Thank you so much for this example….
Guys, can anybody confirm, that this issue doesn’t exist in SDK 3.4?
Thanks!
@Borman from what I can recall the problem exists throughout all version 3 SDK releases!
I had this issue too, and setting the drop-down’s data-provider worked fine. It is my understanding that in the 3.6 updates of the framework, this has been fixed, however I can’t use that build so I can’t be sure. Thanks for a solution, even if (hopefully) it is only temporary.
2 Trackbacks
[...] This post was mentioned on Twitter by Simon Bailey, MojoGeeks. MojoGeeks said: Changing DataProvider in a Flex ComboBox Problem Fix: I have stumbled across an old fix I found for a problem I ha… http://bit.ly/b0m2uT [...]
[...] Changing DataProvider in a Flex ComboBox Problem Fix http://www.newtriks.com/?p=935 [...]