- 浏览: 1148794 次
- 性别:
- 来自: 北京
文章分类
- 全部博客 (411)
- Java Foundation (41)
- AI/机器学习/数据挖掘/模式识别/自然语言处理/信息检索 (2)
- 云计算/NoSQL/数据分析 (11)
- Linux (13)
- Open Source (12)
- J2EE (52)
- Data Structures (4)
- other (10)
- Dev Error (41)
- Ajax/JS/JSP/HTML5 (47)
- Oracle (68)
- FLEX (19)
- Tools (19)
- 设计模式 (4)
- Database (12)
- SQL Server (9)
- 例子程序 (4)
- mysql (2)
- Web Services (4)
- 面试 (8)
- 嵌入式/移动开发 (18)
- 软件工程/UML (15)
- C/C++ (7)
- 架构Architecture/分布式Distributed (1)
最新评论
-
a535114641:
LZ你好, 用了这个方法后子页面里的JS方法就全不能用了呀
页面局部刷新的两种方式:form+iframe 和 ajax -
di1984HIT:
学习了,真不错,做个记号啊
Machine Learning -
赵师傅临死前:
我一台老机器,myeclipse9 + FB3.5 可以正常使 ...
myeclipse 10 安装 flash builder 4.6 -
Wu_Jiang:
触发时间在将来的某个时间 但是第一次触发的时间超出了失效时间, ...
Based on configured schedule, the given trigger will never fire. -
cylove007:
找了好久,顶你
Editable Select 可编辑select
Data Access and Interconnectivity / Validating Data:
http://livedocs.adobe.com/flex/3/html/help.html?content=validators_2.html
上面的摘录说的很清楚:flex validator为我们提供了一种不需要调用服务器端,只在flex client端的验证方式。
但在验证体系中,是否还有调用服务器端的必要那?答案是有的!比如说做添加操作时,某业务主键的是否重复验证,最好就是在点击提交按钮后,调用服务器端,验证所输入的业务主键值是否重复,而不应该使用之前取过的这样一个业务主键list。这样的验证该怎么办那?只能通过扩展flex validator,使其支持远程方法调用来做了:
Showing errors for backend validations:
http://www.actionscript.org/forums/showthread.php3?t=173275
Handle client and server validation with Flex 3?
http://stackoverflow.com/questions/5897917/handle-client-and-server-validation-with-flex-3
custom validator against remote object:
http://stackoverflow.com/questions/3979592/custom-validator-against-remote-object
flex : creating custom validators:
http://flexscript.wordpress.com/2008/09/22/flex-creating-custom-validators/
Using Flex 4 / Enhancing usability / Validating Data -> Using validators:
http://help.adobe.com/en_US/Flex/4.0/UsingSDK/WS2db454920e96a9e51e63e3d11c0bf60efb-7fdd.html
Validating data by using custom validators:
http://help.adobe.com/en_US/flex/using/WS2db454920e96a9e51e63e3d11c0bf68c0f-7ffb.html
Example: Validating multiple fields:
http://livedocs.adobe.com/flex/3/html/help.html?content=createvalidators_4.html#184524
Flex 3 Custom validation of grouped input fields:
http://flexmaster.blog.co.in/2010/06/16/flex-drag-and-drop-the-definitive-tutorial/
通过Validator的validateAll方法对页面所有验证在点击提交按钮时做集中验证:
Validating Flex forms using the Validator classes:
http://blog.flexexamples.com/2007/08/13/validating-flex-forms-using-the-validator-classes/
Using the Validators.validateAll() method to validate a form:
http://blog.flexexamples.com/2007/08/02/using-the-validatorsvalidateall-method-to-validate-a-form/
Working with validation events:
http://livedocs.adobe.com/flex/3/html/help.html?content=validators_6.html
文件上传验证validator例子:
http://www.adobe.com/devnet/flex/articles/custom_validator.html
是否相等validator例子:
http://blowingthroughlines.com/2009/02/18/uncategorized/flex-custom-validator-email-confirmation/
http://livedocs.adobe.com/flex/3/html/help.html?content=validators_2.html
引用
In typical client-server environments, data validation occurs on the server after data is submitted to it from the client. One advantage of using Flex validators is that they execute on the client, which lets you validate input data before transmitting it to the server. By using Flex validators, you eliminate the need to transmit data to and receive error messages back from the server, which improves the overall responsiveness of your application.
Note: Flex validators do not eliminate the need to perform data validation on the server, but provide a mechanism for improving performance by performing some data validation on the client.
Note: Flex validators do not eliminate the need to perform data validation on the server, but provide a mechanism for improving performance by performing some data validation on the client.
上面的摘录说的很清楚:flex validator为我们提供了一种不需要调用服务器端,只在flex client端的验证方式。
但在验证体系中,是否还有调用服务器端的必要那?答案是有的!比如说做添加操作时,某业务主键的是否重复验证,最好就是在点击提交按钮后,调用服务器端,验证所输入的业务主键值是否重复,而不应该使用之前取过的这样一个业务主键list。这样的验证该怎么办那?只能通过扩展flex validator,使其支持远程方法调用来做了:
Showing errors for backend validations:
http://www.actionscript.org/forums/showthread.php3?t=173275
Handle client and server validation with Flex 3?
http://stackoverflow.com/questions/5897917/handle-client-and-server-validation-with-flex-3
custom validator against remote object:
http://stackoverflow.com/questions/3979592/custom-validator-against-remote-object
flex : creating custom validators:
http://flexscript.wordpress.com/2008/09/22/flex-creating-custom-validators/
引用
All standard validators components inherits from the base of mx.Validators.Validator class. To create a custom validator need to work with extending the Validator class. The creation of custom validator includes following steps;
A) Create a class which extends mx.Validators.Validator.
B) Class must override doValidation() method.
C) Overridden doValidation() method should accept a parameter of type Object.
D) Overridden doValidation() method should return an Array.
If the validation of a condition against given object doesn’t succeed, then doValidation() method returns an array containing objects of ValidationResult. If doValidation() method does succeed then method returns an empty array.
A) Create a class which extends mx.Validators.Validator.
B) Class must override doValidation() method.
C) Overridden doValidation() method should accept a parameter of type Object.
D) Overridden doValidation() method should return an Array.
If the validation of a condition against given object doesn’t succeed, then doValidation() method returns an array containing objects of ValidationResult. If doValidation() method does succeed then method returns an empty array.
Using Flex 4 / Enhancing usability / Validating Data -> Using validators:
http://help.adobe.com/en_US/Flex/4.0/UsingSDK/WS2db454920e96a9e51e63e3d11c0bf60efb-7fdd.html
引用
trigger Specifies the component generating the event that triggers the validator. If omitted, by default Flex uses the value of the source property.
triggerEvent Specifies the event that triggers the validation. If omitted, Flex uses the valueCommit event. Flex dispatches the valueCommit event whenever the value of a control changes. Usually this is when the user removes focus from the component, or when a property value is changed programmatically. If you want a validator to ignore all events, set triggerEvent to an empty string (""). For information on specific validator classes, see Using standard validators.
triggerEvent Specifies the event that triggers the validation. If omitted, Flex uses the valueCommit event. Flex dispatches the valueCommit event whenever the value of a control changes. Usually this is when the user removes focus from the component, or when a property value is changed programmatically. If you want a validator to ignore all events, set triggerEvent to an empty string (""). For information on specific validator classes, see Using standard validators.
Validating data by using custom validators:
http://help.adobe.com/en_US/flex/using/WS2db454920e96a9e51e63e3d11c0bf68c0f-7ffb.html
引用
About overriding the doValidation() method
Your custom validator class must contain an override of the protected Validator.doValidation() method that takes a single argument, value, of type Object, and returns an Array of ValidationResult objects. You return one ValidationResult object for each field that the validator examines and that fails the validation. For fields that pass the validation, you omit the ValidationResult object.
You do not have to create a ValidationResult object for fields that validate successfully. Flex creates those ValidationResult objects for you.
The base Validator class implements the logic to handle required fields by using the required property. When set to true, this property specifies that a missing or empty value in a user-interface control causes a validation error. To disable this verification, set this property to false.
In the doValidation() method of your validator class, you typically call the base class’s doValidation() method to perform the verification for a required field. If the user did not enter a value, the base class issues a validation error stating that the field is required.
The remainder of the doValidation() method contains your custom validation logic.
Your custom validator class must contain an override of the protected Validator.doValidation() method that takes a single argument, value, of type Object, and returns an Array of ValidationResult objects. You return one ValidationResult object for each field that the validator examines and that fails the validation. For fields that pass the validation, you omit the ValidationResult object.
You do not have to create a ValidationResult object for fields that validate successfully. Flex creates those ValidationResult objects for you.
The base Validator class implements the logic to handle required fields by using the required property. When set to true, this property specifies that a missing or empty value in a user-interface control causes a validation error. To disable this verification, set this property to false.
In the doValidation() method of your validator class, you typically call the base class’s doValidation() method to perform the verification for a required field. If the user did not enter a value, the base class issues a validation error stating that the field is required.
The remainder of the doValidation() method contains your custom validation logic.
Example: Validating multiple fields:
http://livedocs.adobe.com/flex/3/html/help.html?content=createvalidators_4.html#184524
Flex 3 Custom validation of grouped input fields:
http://flexmaster.blog.co.in/2010/06/16/flex-drag-and-drop-the-definitive-tutorial/
通过Validator的validateAll方法对页面所有验证在点击提交按钮时做集中验证:
Validating Flex forms using the Validator classes:
http://blog.flexexamples.com/2007/08/13/validating-flex-forms-using-the-validator-classes/
Using the Validators.validateAll() method to validate a form:
http://blog.flexexamples.com/2007/08/02/using-the-validatorsvalidateall-method-to-validate-a-form/
Working with validation events:
http://livedocs.adobe.com/flex/3/html/help.html?content=validators_6.html
引用
<?xml version="1.0"?> <!-- validators\ValEventListener.mxml --> <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"> <mx:Script> <![CDATA[ // Import event class import mx.events.ValidationResultEvent; private function handleValid(event:ValidationResultEvent):void { if(event.type==ValidationResultEvent.VALID) submitButton.enabled = true; else submitButton.enabled = false; } // Submit form is everything is valid. private function submitForm():void { // Handle submit. } ]]> </mx:Script> <mx:ZipCodeValidator source="{inputZip}" property="text" valid="handleValid(event);" invalid="handleValid(event);"/> <mx:TextInput id="inputZip"/> <mx:TextInput id="inputPn"/> <mx:Button id="submitButton" label="Submit" enabled="false" click="submitForm();"/> </mx:Application>
文件上传验证validator例子:
http://www.adobe.com/devnet/flex/articles/custom_validator.html
是否相等validator例子:
http://blowingthroughlines.com/2009/02/18/uncategorized/flex-custom-validator-email-confirmation/
发表评论
-
myeclipse 10 安装 flash builder 4.6
2011-12-11 12:47 15454从Flash Builder 4 之后,ado ... -
FLEX:Nested Object & Nested Data Grid
2011-08-15 18:14 2159Flex Nested Object & Nested ... -
FLEX 服务器端交互: remoteObject & AsyncToken & 数据定时刷新 & Timer
2011-06-21 18:47 2788动态调用RemoteObject: Dynamically i ... -
FLEX : Tree & contextMenu & Array's filter & ArrayCollection's filterFunction
2011-05-29 16:05 1932Using Flex 4.5 / Using data-dri ... -
FLEX : ObjectProxy & <fx:Model> tag
2011-05-28 21:37 2023今天碰到了一个非常让我困扰的问题,使我觉得很有必要对Objec ... -
Flex:Application&Variable Scope(this owner parent parentApp parentDoc outerDoc)
2011-05-28 17:18 1433关键字: this owner parent parentA ... -
Flex : Performance tuning 性能调优
2011-05-28 14:50 1708附件: Flex Application Performanc ... -
FLEX example 例子
2011-05-28 12:12 3234How to find an ArrayCollection ... -
FLEX : Event 事件
2011-05-24 19:51 1724ActionScript 3.0 Developer’s Gu ... -
FLEX:Data Binding 数据绑定
2011-05-24 14:44 3645务须精读的文章: Flex data binding pitf ... -
FLEX Component 组件 汇总
2011-05-23 13:56 2312Combox默认将对象中名为label的属性作为显示用的lab ... -
FLEX : dragEnabled & dropEnabled
2011-05-22 17:38 1720通过设置dragEnabled属性为true,可以使这些控件作 ... -
FLEX Data type 数据类型
2011-05-22 09:21 2092Programming ActionScript 3.0 / ... -
FLEX ERROR WARNING 总结
2011-05-22 08:13 3244常会碰到的错误:TypeError: Error #1009: ... -
Flex: labelFunction versus ItemRenderer
2011-05-22 07:16 3297When to Use labelFunction versu ... -
Flex Application 初始化顺序
2011-05-22 06:15 1670http://blog.csdn.net/chengyong ... -
Flex Metadata 元数据:Bindable(注意首字母大写),etc
2011-05-22 06:08 1782Adobe® Flex™ 3.2 语言参考 -> 元数据 ... -
FLEX笔记
2009-04-15 10:29 2347Adobe Flex 4 官方资料库: http://help ...
相关推荐
2. 动态验证:在用户输入时即时进行验证,可以立即反馈错误,提高用户体验。 四、`from_validator`使用示例 以下是一个简单的使用`from_validator`进行表单验证的例子: ```xml <!-- MXML 示例 --> <s:Form id=...
在Flex开发中,表单验证是一项关键任务,它确保用户输入的数据符合预设的规则,保证数据质量和系统安全。本文将深入探讨“flex form 验证”这一主题,结合给出的文件名,我们来详细讲解Flex中表单验证的相关知识点。...
Flex 内置验证器是 Flex 框架中用于确保用户输入数据有效性的工具,它们提供了多种验证方式,包括实时验证、提交值验证、通过性验证和脚本式验证。这些验证器帮助开发者轻松地检查用户输入,确保数据格式正确且符合...
在Flex中,我们可以使用Validator类来创建自定义验证器。首先,你需要创建一个继承自mx.validators.Validator的子类,覆盖validate()方法。在这个方法中,你可以添加你的验证逻辑,比如检查字段是否为空。如果字段为...
1. **验证组件**:Flex提供了多种内置验证组件,如Validator,它可以检查用户的输入是否符合预设规则,例如邮箱格式、数字范围等。开发者可以通过自定义验证规则扩展这些组件。 2. **事件驱动**:Flex验证过程通常...
Flex允许在不同的时间点进行验证:实时验证(live validation)会在用户输入时立即执行,提交验证(commit validation)只在用户提交表单时执行。这可以通过设置Validator的validateOnCommit属性来控制。 6. **组...
这些验证组件是基于Adobe Flex框架的Validator功能,能够为表单字段提供实时或提交时的验证,提高用户体验并减少服务器端的压力。 Flex验证组件的核心在于`Validator`类,它允许开发者定义验证规则,并在用户输入...
1. 服务端数据验证:当表单提交到服务器后,服务器端程序对数据进行验证。这种方式安全度高,但增加了服务器的负担和用户等待时间。 2. 客户端数据验证:在数据发送到服务器之前,先在客户端进行验证。这种方式可以...
数据验证在Flex中通常涉及到两个主要的类:Validator和Formatters。Validator类用于检查用户输入是否符合预设的验证规则,如非空、数字范围、邮箱格式等。这些验证规则可以通过创建Validator实例并设置其属性来实现...
在Flex中,可以通过内置的验证器类来实现这一目标,这些验证器包括但不限于`CreditCardValidator`、`CurrencyValidator`、`DateValidator`和`EmailValidator`等。 #### 验证器的使用方式 验证器通常被定义在组件的...
使用到了验证控件Validator;使用了CSS样式对Alert对话框进行了修饰;使用了样式对Accordion的Canvas上的lable字体做了修饰。 总结:对Flex和Java对象之间的转换还要进一步的研究,认识到Flex中样式的重要性。Flex的...
在Flex中,我们可以使用`Validator`类结合正则表达式进行数据验证。例如: ```actionscript var emailValidator:Validator = new Validator(); emailValidator.source = emailInput; emailValidator.property = ...
- **CreditCardValidator**: 验证信用卡号码的有效性。 - **CurrencyValidator**: 验证货币数值的有效性。 - **DataValidator**: 验证日期格式。 - **EmailValidator**: 验证电子邮件地址的有效性。 - **...
Flex4提供了Validator类,开发者可以通过继承这个基类来创建自定义的验证规则。内置的验证器包括StringValidator(用于检查字符串长度或格式)、NumberValidator(检查数值范围)以及DateValidator(验证日期格式)...
通过Validator类,开发者可以轻松地添加验证逻辑到表单组件上,提高用户体验并减少错误。 在Flex3中,你可以使用预定义的验证控件如NumberValidator、EmailValidator等,或者自定义验证规则。这些控件通常与Form或...
Flex提供了验证框架,可以通过Validator类实现。同时,当出现错误时,应使用错误提示和错误对象来通知用户。 通过以上知识点的应用,你可以创建一个功能完善的、带有复选框的Flex Datagrid,提供给用户高效、直观的...
5. 实现数据绑定和验证,包括使用BindingUtils类、Validator类和Form类等。 6. 使用Flex Builder开发工具,包括创建新项目、设计用户界面、编写代码和调试应用程序等。 此外,本教程还涵盖了一些高级话题,例如: ...
#### 第15章 - Custom Formatter, Validator, and Effect Components(自定义格式器、验证器和效果组件) 除了UI组件外,Flex还支持创建自定义的格式器、验证器和效果组件,用于数据格式化、输入验证和动画效果。本...
Validator用于验证输入数据的有效性,如CreditCardValidator(信用卡验证器)、CurrencyValidator(货币验证器)、EmailValidator(电子邮件验证器)等。Formatter则用于格式化数据,例如CurrencyFormatter(货币...