flex4里的双向数据绑定
来源:互联网 发布:beta理财顾问软件 编辑:程序博客网 时间:2024/04/30 19:15
在flex3中,对于绑定可以这样:
<TextInput id="fahrenheit" text="{celsius.text}"/>
<TextInput id="celsius" text="{fahrenheit.text}">
在FLEX4中,可以这样了,双向:
<TextInput id="fahrenheit" text="@{celsius.text}"/>
<TextInput id="celsius">
这样,任意一个文本框输入,都可以两个一起同步显示
再来看个例子;
<?xml version="1.0" encoding="utf-8"?>
<s:Application xmlns:fx="http://ns.adobe.com/mxml/2009"
xmlns:s="library://ns.adobe.com/flex/spark"
xmlns:mx="library://ns.adobe.com/flex/halo"
minWidth="1024" minHeight="768">
<fx:Binding source="txt2.text" destination="txt3.text" twoWay="true" />
<s:Panel width="300" height="200" x="50" y="50" title="双向绑定">
<s:layout>
<s:VerticalLayout paddingTop="10" gap="3"
horizontalAlign="center"/>
</s:layout>
<s:TextInput id="txt1" text="@{txt2.text}" />
<s:TextInput id="txt2" text="@{txt1.text}" />
<s:TextInput id="txt3" />
</s:Panel>
</s:Application>
<TextInput id="fahrenheit" text="{celsius.text}"/>
<TextInput id="celsius" text="{fahrenheit.text}">
在FLEX4中,可以这样了,双向:
<TextInput id="fahrenheit" text="@{celsius.text}"/>
<TextInput id="celsius">
这样,任意一个文本框输入,都可以两个一起同步显示
再来看个例子;
<?xml version="1.0" encoding="utf-8"?>
<s:Application xmlns:fx="http://ns.adobe.com/mxml/2009"
xmlns:s="library://ns.adobe.com/flex/spark"
xmlns:mx="library://ns.adobe.com/flex/halo"
minWidth="1024" minHeight="768">
<fx:Binding source="txt2.text" destination="txt3.text" twoWay="true" />
<s:Panel width="300" height="200" x="50" y="50" title="双向绑定">
<s:layout>
<s:VerticalLayout paddingTop="10" gap="3"
horizontalAlign="center"/>
</s:layout>
<s:TextInput id="txt1" text="@{txt2.text}" />
<s:TextInput id="txt2" text="@{txt1.text}" />
<s:TextInput id="txt3" />
</s:Panel>
</s:Application>
- flex4里的双向数据绑定
- FLEX4 DropDownList/combobox双向数据绑定binding默认赋值
- flex4数据绑定的深入理解
- flex4 数据绑定
- Flex4 数据绑定
- AngularJS的双向数据绑定
- AngularJS数据的双向绑定
- angular 的数据双向绑定
- angular2数据的双向绑定
- 关于数据的双向绑定
- Angular4的双向数据绑定
- Flex4 数据绑定简单示例
- 双向数据绑定---AngularJS的基本原理学习
- 3、AngularJs的双向数据绑定
- 利用defineProperty实现数据的双向绑定
- 双向数据绑定---AngularJS的基本原理学习
- vue双向数据绑定的原理解密
- angularJs的双向数据绑定,简单实用
- Bonjour
- php中双引号和单引号的区别
- Mysql索引优化
- php 5.3下跟CI 1.7.2配合时"The URI you submitted has disallowed characters"错误的解决
- Qt程序非线程类中sleep()函数的替代方法。
- flex4里的双向数据绑定
- (转)sphinx安装配置手记
- evernote-mode 不能登录的解决办法
- 一位老外眼中的php bad code example,大家来看看
- php5中的===与==
- asp.net 2010中jquery调用webservice
- VC++ 6中编译Unicode时出现error LNK2001: unresolved external symbol _WinMain@16
- SLA——服务水平协议
- 一个好用的检查密码强度的正则表达式