2
votes

My Combobox is not alway updating when I update the ArrayCollection.

[Bindable] public var newUserList:ArrayCollection

<mx:ComboBox x="10" y="77" prompt="Select a Name" dataProvider="{newUserList}" labelField="displayName" width="182" id="lstNewUser"></mx:ComboBox>

... I then make a remote call to retrieve a new set of data an assign it to the ArrayCollection

newUserList = event.result as ArrayCollection;

the first time it updates the combobox fine and sometimes it works the 2nd, 3rd, etc time is might update the combo box. After it stops updating the combobox, it never does until I restart the app. I have verified that the ArrayCollection is updated via the debug data, it is just the combobox is not updating the display.

2
What you describe should work w/o issues. Based on the code you supplied it is not obvious what the error is. When you say "The ComboBox is not updating" what does that mean? How are you expecting it to update? You said you verified that the ArrayCollection is updated [I assume the newUserList]; have you verified that the comboBox dataProvider is updating?JeffryHouser

2 Answers

3
votes

This is a very common issue in combobox. (Is there no duplicates in SO?)

You need to set combobox.dropdown.dataprovider also. ( I could not get a my code and so here is the link from google's first result.)

http://www.newtriks.com/?p=935

1
votes

Solution:

if(fixedCB.dropdown) fixedCB.dropdown.dataProvider=value;
fixedCB.dropdown.width = fixedCB.width;

thanks to: http://newtriks.com/2010/06/03/changing-dataprovider-in-a-flex-combobox-problem-fix/