开发者

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 veri开发者_C百科fied that the ArrayCollection is updated via the debug data, it is just the combobox is not updating the display.


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


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/

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜