`
Supanccy2013
  • 浏览: 215506 次
  • 性别: Icon_minigender_1
  • 来自: 深圳
社区版块
存档分类
最新评论

flex validator 之通过性验证

    博客分类:
  • Flex
阅读更多
注:原创作品,分享以供交流学习,转载请注明出处。

  通过性验证是在按下提交按钮的时候开始验证全部的组件。

<?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/mx" minWidth="955" minHeight="600">
	<s:layout>
		<s:BasicLayout/>
	</s:layout>
	<fx:Declarations>
		<!-- 将非可视元素(例如服务、值对象)放在此处 -->
		<mx:StringValidator source="{username}"
							property="text"
							minLength="6"
							trigger="{SubmitButton}"
							triggerEvent="click"
							/>
		<mx:EmailValidator source="{email}"
						   property="text"
						   trigger="{SubmitButton}"
						   triggerEvent="click"
						   />
	</fx:Declarations>
	
	<s:VGroup horizontalCenter="0" verticalCenter="0">
		<s:Label text="email:"/>
		<s:TextInput id="email"/>
		<s:Label text="userName"/>
		<s:TextInput id="username"/>
		<s:Button label="Submit" id="SubmitButton"/>
	</s:VGroup>
</s:Application>

分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics