List itemRenderer 缓存项目

发布于 2024-11-27 01:58:25 字数 307 浏览 0 评论 0原文

我在 mx:list 中使用 itemRenderer,它有许多文本字段和组合,我使用此项目渲染器来编辑数组集合中的项目,arrayCollection 中的每个项目都是 Action 类型,它来自 BlazeDS 远程处理作为 valueObject。

我的问题是,当我通过此代码将 Action 类型的新项目添加到列表 dataProvider (ArrayCollection) 时,

myList.dataProvider.addItem(new Action());

新项目从其前一个项目中获取相同的数据。

i am using an itemRenderer in mx:list, it has many text fields and combos, i use this item renderer to edit items in array collection, each item in the arrayCollection is of type Action which comes from BlazeDS remoting as a valueObject.

my problem is when i add new item of type Action to the list dataProvider (ArrayCollection) by this code

myList.dataProvider.addItem(new Action());

the new item tooks the same data from its previous item.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

过潦 2024-12-04 01:58:25

在您的项目渲染器中,请确保绑定到数据对象,因为这是 flex 将设置为要渲染的数据提供程序中的当前项目的内容。它就像这样简单:

<s:Label text="{data.someLabel}" />

如果需要采取任何其他操作,请尝试覆盖数据设置器:

public override function set data(value:Object):void{
    super.data = value;
    //do anything else that is required.
}

In your item renderer, be sure to bind to the data object, as this is what flex will set as the current item from your data provider to be rendered. It would be as simple as:

<s:Label text="{data.someLabel}" />

if there is any additional action that needs to be taken, look to override the data setter:

public override function set data(value:Object):void{
    super.data = value;
    //do anything else that is required.
}
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文