2个回答
展开全部
补充:你把所需要显示的列表的dataProvider和你自己定义的那个ArrayCollection用BindingUtils邦定,只要你的这个ArrayCollection的值发生了变化,那么你显示出来的列表随时也跟着变了。
可以通过使用mx.binding.utils.BindingUtils类来实现
其中有一个方法bindProperty(site:Object, prop:String, host:Object, chain:Object, commitOnly:Boolean = false):ChangeWatcher
使用时比如
BindingUtils.bindProperty(list,"dataProvider",this,"thisData");
或者
BindingUtils.bindProperty(textInput, "text", userVO, "name");
具体的帮助中是这样写的:(可以参见)
bindProperty () method
public static function bindProperty(site:Object, prop:String, host:Object, chain:Object, commitOnly:Boolean = false):ChangeWatcher
Binds a public property, prop on the site Object, to a bindable property or property chain. If a ChangeWatcher instance is successfully created, prop is initialized to the current value of chain.
Parameters site:Object — The Object defining the property to be bound to chain.
prop:String — The name of the public property defined in the site Object to be bound. The property will receive the current value of chain, when the value of chain changes.
host:Object — The object that hosts the property or property chain to be watched.
chain:Object — A value specifying the property or chain to be watched. Legal values are:
String containing the name of a public bindable property of the host object.
An Object in the form: }. This Object must contain the name of, and a getter function for, a public bindable property of the host object.
A non-empty Array containing a combination of the first two options that represents a chain of bindable properties accessible from the host. For example, to bind the property host.a.b.c, call the method as: bindProperty(host, ["a","b","c"], ...).
Note: The property or properties named in the chain argument must be public, because the describeType() method suppresses all information about non-public properties, including the bindability metadata that ChangeWatcher scans to find the change events that are exposed for a given property. However, the getter function supplied when using the argument form described above can be used to associate an arbitrary computed value with the named (public) property.
commitOnly:Boolean (default = false) — Set to true if the handler should be called only on committing change events; set to false if the handler should be called on both committing and non-committing change events. Note: the presence of non-committing change events for a property is indicated by the [NonCommittingChangeEvent(<event-name>)] metadata tag. Typically these tags are used to indicate fine-grained value changes, such as modifications in a text field prior to confirmation.
Returns ChangeWatcher — A ChangeWatcher instance, if at least one property name has been specified to the chain argument; null otherwise.
可以通过使用mx.binding.utils.BindingUtils类来实现
其中有一个方法bindProperty(site:Object, prop:String, host:Object, chain:Object, commitOnly:Boolean = false):ChangeWatcher
使用时比如
BindingUtils.bindProperty(list,"dataProvider",this,"thisData");
或者
BindingUtils.bindProperty(textInput, "text", userVO, "name");
具体的帮助中是这样写的:(可以参见)
bindProperty () method
public static function bindProperty(site:Object, prop:String, host:Object, chain:Object, commitOnly:Boolean = false):ChangeWatcher
Binds a public property, prop on the site Object, to a bindable property or property chain. If a ChangeWatcher instance is successfully created, prop is initialized to the current value of chain.
Parameters site:Object — The Object defining the property to be bound to chain.
prop:String — The name of the public property defined in the site Object to be bound. The property will receive the current value of chain, when the value of chain changes.
host:Object — The object that hosts the property or property chain to be watched.
chain:Object — A value specifying the property or chain to be watched. Legal values are:
String containing the name of a public bindable property of the host object.
An Object in the form: }. This Object must contain the name of, and a getter function for, a public bindable property of the host object.
A non-empty Array containing a combination of the first two options that represents a chain of bindable properties accessible from the host. For example, to bind the property host.a.b.c, call the method as: bindProperty(host, ["a","b","c"], ...).
Note: The property or properties named in the chain argument must be public, because the describeType() method suppresses all information about non-public properties, including the bindability metadata that ChangeWatcher scans to find the change events that are exposed for a given property. However, the getter function supplied when using the argument form described above can be used to associate an arbitrary computed value with the named (public) property.
commitOnly:Boolean (default = false) — Set to true if the handler should be called only on committing change events; set to false if the handler should be called on both committing and non-committing change events. Note: the presence of non-committing change events for a property is indicated by the [NonCommittingChangeEvent(<event-name>)] metadata tag. Typically these tags are used to indicate fine-grained value changes, such as modifications in a text field prior to confirmation.
Returns ChangeWatcher — A ChangeWatcher instance, if at least one property name has been specified to the chain argument; null otherwise.
ZESTRON
2024-09-04 广告
2024-09-04 广告
在Dr. O.K. Wack Chemie GmbH,我们高度重视ZESTRON的表界面分析技术。该技术通过深入研究材料表面与界面的性质,为提升产品质量与可靠性提供了有力支持。ZESTRON的表界面分析不仅涵盖了相变化、化学反应、吸附与解吸...
点击进入详情页
本回答由ZESTRON提供
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询