- 浏览: 7356686 次
- 性别:
- 来自: 上海
-
文章分类
- 全部博客 (1546)
- 企业中间件 (236)
- 企业应用面临的问题 (236)
- 小布Oracle学习笔记汇总 (36)
- Spring 开发应用 (54)
- IBatis开发应用 (16)
- Oracle基础学习 (23)
- struts2.0 (41)
- JVM&ClassLoader&GC (16)
- JQuery的开发应用 (17)
- WebService的开发应用 (21)
- Java&Socket (44)
- 开源组件的应用 (254)
- 常用Javascript的开发应用 (28)
- J2EE开发技术指南 (163)
- EJB3开发应用 (11)
- GIS&Mobile&MAP (36)
- SWT-GEF-RCP (52)
- 算法&数据结构 (6)
- Apache开源组件研究 (62)
- Hibernate 学习应用 (57)
- java并发编程 (59)
- MySQL&Mongodb&MS/SQL (15)
- Oracle数据库实验室 (55)
- 搜索引擎的开发应用 (34)
- 软件工程师笔试经典 (14)
- 其他杂项 (10)
- AndroidPn& MQTT&C2DM&推技术 (29)
- ActiveMQ学习和研究 (38)
- Google技术应用开发和API分析 (11)
- flex的学习总结 (59)
- 项目中一点总结 (20)
- java疑惑 java面向对象编程 (28)
- Android 开发学习 (133)
- linux和UNIX的总结 (37)
- Titanium学习总结 (20)
- JQueryMobile学习总结 (34)
- Phonegap学习总结 (32)
- HTML5学习总结 (41)
- JeeCMS研究和理解分析 (9)
最新评论
-
lgh1992314:
[u][i][b][flash=200,200][url][i ...
看看mybatis 源代码 -
尼古拉斯.fwp:
图片根本就不出来好吧。。。。。。
Android文件图片上传的详细讲解(一)HTTP multipart/form-data 上传报文格式实现手机端上传 -
ln94223:
第一个应该用排它网关吧 怎么是并行网关, 并行网关是所有exe ...
工作流Activiti的学习总结(八)Activiti自动执行的应用 -
ZY199266:
获取不到任何消息信息,请问这是什么原因呢?
ActiveMQ 通过JMX监控Connection,Queue,Topic的信息 -
xiaoyao霄:
DestinationSourceMonitor 报错 应该导 ...
ActiveMQ 通过JMX监控Connection,Queue,Topic的信息
BindingUtils的工具类的源代码:
此类用于绑定对象和组件的关系,减少在使用的多余累赘的代码:
package mx.binding.utils
{
import mx.binding.utils.ChangeWatcher;
/**
*
*/
public class BindingUtils
{
include "../../core/Version.as";
//--------------------------------------------------------------------------
//
// Class methods
//
//--------------------------------------------------------------------------
/**
* Binds a public property, <code>prop</code> on the <code>site</code>
* Object, to a bindable property or property chain.
* If a ChangeWatcher instance is successfully created, <code>prop</code>
* is initialized to the current value of <code>chain</code>.
*
* @param site The Object defining the property to be bound
* to <code>chain</code>.
*
* @param prop The name of the public property defined in the
* <code>site</code> Object to be bound.
* The property will receive the current value of <code>chain</code>,
* when the value of <code>chain</code> changes.
*
* @param host The object that hosts the property or property chain
* to be watched.
*
* @param chain A value specifying the property or chain to be watched.
* Legal values are:
* <ul>
* <li>String containing the name of a public bindable property
* of the host object.</li>
*
* <li>An Object in the form:
* <code>{ name: <i>property name</i>, getter: function(host) { return host[<i>property name</i>] } }</code>.
* This Object must contain the name of, and a getter function for,
* a public bindable property of the host object.</li>
*
* <li>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 <code>host.a.b.c</code>,
* call the method as:
* <code>bindProperty(host, ["a","b","c"], ...)</code>.</li>
* </ul>
*
* <p>Note: The property or properties named in the <code>chain</code> argument
* must be public, because the <code>describeType()</code> 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 <code>{ name, getter }</code>
* argument form described above can be used to associate an arbitrary
* computed value with the named (public) property.</p>
*
* @param commitOnly Set to <code>true</code> if the handler
* should be called only on committing change events;
* set to <code>false</code> 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 <code>[NonCommittingChangeEvent(<event-name>)]</code>
* metadata tag.
* Typically these tags are used to indicate fine-grained value changes,
* such as modifications in a text field prior to confirmation.
*
* @return A ChangeWatcher instance, if at least one property name has
* been specified to the <code>chain</code> argument; null otherwise.
*/
public static function bindProperty(
site:Object, prop:String,
host:Object, chain:Object,
commitOnly:Boolean = false):ChangeWatcher
{
var w:ChangeWatcher =
ChangeWatcher.watch(host, chain, null, commitOnly);
if (w != null)
{
var assign:Function = function(event:*):void
{
site[prop] = w.getValue();
};
w.setHandler(assign);
assign(null);
}
return w;
}
/**
* Binds a setter function, <code>setter</code>, to a bindable property
* or property chain.
* If a ChangeWatcher instance is successfully created,
* the setter function is invoked with one argument that is the
* current value of <code>chain</code>.
*
* @param setter Setter method to invoke with an argument of the current
* value of <code>chain</code> when that value changes.
*
* @param host The host of the property.
* See the <code>bindProperty()</code> method for more information.
*
* @param name The name of the property, or property chain.
* See the <code>bindProperty()</code> method for more information.
*
* @param commitOnly Set to <code>true</code> if the handler should be
* called only on committing change events.
* See the <code>bindProperty()</code> method for more information.
*
* @return A ChangeWatcher instance, if at least one property name
* has been specified to the <code>chain</code> argument; null otherwise.
*/
public static function bindSetter(setter:Function, host:Object,
chain:Object,
commitOnly:Boolean = false):ChangeWatcher
{
var w:ChangeWatcher =
ChangeWatcher.watch(host, chain, null, commitOnly);
if (w != null)
{
var invoke:Function = function(event:*):void
{
setter(w.getValue());
};
w.setHandler(invoke);
invoke(null);
}
return w;
}
}
}
使用简介:
public static function bindProperty(
site:Object, prop:String,
host:Object, chain:Object,
commitOnly:Boolean = false):ChangeWatcher
site:绑定的组件
prop:绑定组件一个属性
host:绑定组件的一个对象
chain: 绑定组件对象host的一个属性
public static function bindSetter(setter:Function, host:Object,
chain:Object,
commitOnly:Boolean = false):ChangeWatcher
setter:绑定一个方法
host:绑定属性的对象
name:绑定的属性
将对象tickOrder一个属性ORDER_PROCESS_STATUS 绑定到组件ORDER_PROCESS_STATUS的selectedValue属性
实现双向绑定:
如下:
BindingUtils.bindProperty(ORDER_PROCESS_STATUS, "selectedValue", ticOrder, "ORDER_PROCESS_STATUS");
BindingUtils.bindProperty(ticOrder, "ORDER_PROCESS_STATUS", ORDER_PROCESS_STATUS, "selectedValue");
发表评论
-
flex 中As3Commons的使用學習
2009-10-15 12:53 3745學習Java的人,知道java中反射的强大, ... -
flex的国家化的应用
2009-09-23 08:59 2098在项目中需要使用发送短信模板的功能的,根据主题不同,模板不同, ... -
flex的沙箱问题
2009-09-14 17:14 5462在flex与google的地图整合中发现,点击了goog ... -
Flex 常用技巧
2009-09-04 13:00 2593flex是一种异步请求的技术,如果要实现同步必须在传递函 ... -
Flex 開發Google地圖
2009-08-24 13:16 24641 .获取googe的key 2.下载google的fle ... -
查询之order by,group by和having的使用
2009-08-08 15:48 4739在项目中查询常驻酒店的中住的次数最多的前10个酒店: 代码如 ... -
objectProxy的监控对象应用
2009-08-08 13:46 2690在项目中查询根据一个字段发生实现需要特殊的功能,作出相应的动作 ... -
Flex 依赖注入
2009-08-08 13:41 2108了解依赖注入 众所周 ... -
Flex 与外部的数据通信(HTTPService,URLLoader和URLRequest)
2009-08-08 13:36 7448ActionScript 3.0中提供的数据加载请求类主要是H ... -
flex 数据绑定
2009-08-08 13:31 24179.2.1 函数和类级别的绑定 [Bindable]标签打使 ... -
Flex中Entity对象与Display对象之间的数据双向动态绑定
2009-08-08 13:27 2472flex项目中对象的和组 ... -
学习ActionScript 3.0的新特点
2009-08-06 13:05 2027ActionScript3.0 是一种类型 ... -
理解 Flex itemRenderer - 第 1 部分: 内联渲染器
2009-08-05 16:37 3149Flex 提供许多控制, 它们可以按不同方式显示大量数据。Li ... -
flex 中类似Google的提示下拉菜单实现
2009-08-01 16:28 5426项目中使用类似Gooogle输入提示菜单的实现如下 ... -
针对Flex中组件的扩展的应用开发
2009-08-01 16:04 2877在项目中使用一个自定义的CheckboxGroup组件继承自C ... -
Flex类似Google搜索提示的两种做法思路
2009-08-01 15:52 2690做了个简单的搜索提示 ... -
Flex中直接获取某个组件的对象
2009-08-01 15:47 2471Flex中直接获取某个组件的对象方案1: 遍历这些butto ... -
flex 查看类的各种数据的权限
2009-08-01 15:18 1881查看类的一些属性的信息:可读,可写,可读可写。 ... -
flex中getDefinitionByName 函数的使用
2009-08-01 12:40 6752在项目中自定义一个CheckboxGroup,这个控件里面 ... -
Flex 学习中数据类型必须注意的几点
2009-08-01 12:36 2289在字符串转换为int类型必须使用 最好如下: var a:i ...
相关推荐
此外,Flex 还提供 `BindingUtils` 工具类,用于执行动态绑定操作,例如 `BindingUtils.bindProperty(source, sourceProp, target, targetProp)`,这允许在运行时创建绑定。 总之,数据绑定是 Flex 3 中的核心特性...
在Flex开发中,动态绑定是将一个组件的属性值与另一个组件的属性值关联起来,使得当一个组件的属性发生变化时,另一个组件的相应属性也会自动更新。`BindingUtils.bindProperty`是Adobe Flex中用于实现这种动态绑定...
总的来说,Flex提供了一套强大的工具集,用于创建动态、交互的Web应用。理解和掌握这些知识点,能够有效地解决Flex开发过程中遇到的问题,提高开发效率和应用质量。在实际开发中,结合具体需求灵活运用这些技术,将...
Flex 是 Adobe 开发的 RIA(Rich Internet Applications)工具,包括 Flex3 SDK、Flex Builder 和服务器产品,如 Lifestyle Data Services、CodeFushion。Flex 应用程序用 Flash.swf 文件格式封装发布在 HTML 里面,...
- **解释**:本章详细介绍了各种Flex组件,如Alert组件、按钮组件、分组组件、数据组件、文本组件以及布局组件,每个组件都有其独特的功能和用途。 #### 第3章:Flash Media Server 3.0 (简称FMS3) - **知识点**:...
BindingUtils是Flex提供的一个实用工具类,可以用于动态创建绑定关系。这种方式适用于在运行时不确定绑定关系的情况。 **使用方法** 例如,可以使用`BindingUtils.setSource`和`BindingUtils.addTarget`方法来创建...
3. 在ActionScript中使用`BindingUtils`类来绑定属性。 此外,数据绑定符`{}`可以直接引用属性或方法,如`{obj.text.toUpperCase()}`。而`[]`符号则表示属性的变化会触发数据绑定事件。 #### 十三、绑定事件触发 ...
### Flex4.5常见问题总结 #### 一、Flex4.5组件开发模型与特性 ...综上所述,Flex4.5提供了丰富的工具和机制,帮助开发者构建高性能、高互动性的应用程序。理解并掌握这些核心概念,是高效使用Flex进行开发的基础。
在ActionScript 3.0中,Flex的数据绑定主要通过两个类来实现:mx.binding.Binding和mx.binding.utils.BindingUtils。Binding类用于创建和管理数据绑定,而BindingUtils提供了一些静态方法,方便进行数据绑定操作。 ...
5. 实现数据绑定和验证,包括使用BindingUtils类、Validator类和Form类等。 6. 使用Flex Builder开发工具,包括创建新项目、设计用户界面、编写代码和调试应用程序等。 此外,本教程还涵盖了一些高级话题,例如: ...
- 利用FLEX提供的性能分析工具(如Flex Performance Profiler)可以帮助开发者找出潜在的内存泄漏问题。通过这些工具,开发者可以了解哪些资源未被正确释放,以及如何改进代码以提高内存管理效率。 #### 五、总结 ...
本示例通过一个具体的代码片段来展示如何使用Flex中的高级数据绑定技术来实现这一功能。该示例不仅涵盖了基本的数据绑定原理,还涉及到了模型与视图之间的交互、事件监听等高级主题。 #### 核心概念解析 1. **模型...
- **BindingUtils类**: 介绍了如何利用BindingUtils类来进行动态数据绑定。 8. **样式与皮肤** - **样式**: 使用mx:Style标签定义局部样式或引入外部样式表。 - **皮肤**: 通过外部皮肤文件美化应用程序界面。 ...
4. **BindingUtils动态绑定**:在ActionScript代码中,可以使用BindingUtils类的bindProperty或bindMethod方法进行动态绑定。这种方式提供了更大的灵活性,可以在运行时创建绑定。 总的来说,Flex页面跳转和数据...
数据绑定是Flex应用程序开发中的核心概念之一,它指的是将一个对象中的数据与另一个对象中的数据建立连接的过程。通过数据绑定,开发者可以实现在应用程序的不同层级间高效地传输数据。一个典型的数据绑定包括三个...
3. 动态数据绑定,通过ActionScript的BindingUtils类在运行时创建绑定。 通过这些基本概念和技术,开发者可以构建复杂、交互性强的Flex企业应用,实现高效的数据管理和用户交互。了解并熟练掌握MXML和数据绑定,是...
【Flex4基本概念】 Flex4 是 Adobe 引入的一个重要的 Flex 开发框架版本,它引入了许多新特性和改进,特别是在组件模型、...无论是组件设计、事件处理还是数据绑定,Flex4 都为开发者提供了强大的工具和灵活的架构。
- `BindingUtils`类提供了一些静态方法,如`bindProperty()`,用于建立数据绑定。 4. **优化策略** - 为了提高性能,可以使用缓存机制,将已经加载过的Model存储起来,下次需要时直接复用,避免重复加载。 - ...
签的 target 属性。下面的例子展示了如何使用 `<mx:Binding>` 实现相同的效果: ```xml ...无论是简单的属性绑定,还是复杂的函数和对象绑定,Flex 3 都提供了丰富的工具和选项来满足各种需求。
这个示例代码展示了如何在Flex应用中实现用户通过鼠标绘制直线、清除直线以及多点折线的功能。以下是详细的知识点解析: 1. **Flex架构**:这个应用基于Adobe Flex框架,使用Spark组件库,如`s:Application`、`s:...