Jon
Jon

Reputation: 23

Combobox not updating with bindable data

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.

Upvotes: 2

Views: 2131

Answers (2)

Santi
Santi

Reputation: 11

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/

Upvotes: 1

billygoat
billygoat

Reputation: 21984

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

Upvotes: 3

Related Questions