Flex中数组收集的双向数据绑定

发布于 2024-10-05 06:27:06 字数 342 浏览 0 评论 0原文

我使用的是flex 3.5 sdk。我想将数组集合绑定到表单。数组集合的结构是这样的。

MyClass :
var value : String;
var arr : ArrayCollection;

Each element in arr above is an object of MySecondClass

MySecondClass :
var val1 : String;
var val2 : String;
var val3 : String;

我想将 MyClass 对象的数组集合(双向)绑定到一个表单,该表单具有一个表和该表内的另一个表。

我怎样才能做到这一点?

I am using flex 3.5 sdk. I want to bind an array collection to a form. The structure of array collection is like this.

MyClass :
var value : String;
var arr : ArrayCollection;

Each element in arr above is an object of MySecondClass

MySecondClass :
var val1 : String;
var val2 : String;
var val3 : String;

I want to bind array collection of MyClass objects (two-way) to a form which has a table and another table inside this table.

How can I accomplish that ?

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

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

发布评论

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

评论(1

煞人兵器 2024-10-12 06:27:06

您可以尝试将 MySecondClass 中的 var 设置为 binable。

public class MySecondClass {
....
[bindable]
public var1:String;
[bindable]
public var2:String;
[bindable]
public var3:String;
}

如果更改对象的值,则与该数据关联的单元格也应更改。

//PS

在提问者提供更多信息后回答。

您可以添加

<mx:Binding destination="checkbox.selected" source="data.value"/>

You can try set the var in MySecondClass to binable.

public class MySecondClass {
....
[bindable]
public var1:String;
[bindable]
public var2:String;
[bindable]
public var3:String;
}

If you change the value of the object, the cell associated with this data should be change.

//P.S.

Answer after more input from questioner.

You can add the

<mx:Binding destination="checkbox.selected" source="data.value"/>
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文