组合框未使用可绑定数据进行更新
当我更新 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>
... 然后,我进行远程调用来检索一组新数据,并在第一次更新组合框时将其分配给 ArrayCollection
newUserList = event.result as ArrayCollection;
,有时它会在第二次、第三次等时间工作,可能会更新组合框。当它停止更新组合框后,它永远不会更新,直到我重新启动应用程序。我已经验证 ArrayCollection 是通过调试数据更新的,只是组合框没有更新显示。
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.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
这是组合框中非常常见的问题。 (SO中没有重复项吗?)
您还需要设置combobox.dropdown.dataprovider。 (我无法获得我的代码,所以这里是谷歌第一个结果的链接。)
http:// www.newtriks.com/?p=935
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
解决方案:
感谢: http:// /newtriks.com/2010/06/03/changing-dataprovider-in-a-flex-combobox-problem-fix/
Solution:
thanks to: http://newtriks.com/2010/06/03/changing-dataprovider-in-a-flex-combobox-problem-fix/