Repository: flex-utilities Updated Branches: refs/heads/develop ea4cc7ad4 -> 48f47e61c
http://git-wip-us.apache.org/repos/asf/flex-utilities/blob/48f47e61/TourDeFlex/TourDeFlex3/src/validators/RegExValidatorExample.mxml ---------------------------------------------------------------------- diff --git a/TourDeFlex/TourDeFlex3/src/validators/RegExValidatorExample.mxml b/TourDeFlex/TourDeFlex3/src/validators/RegExValidatorExample.mxml deleted file mode 100755 index 0079e28..0000000 --- a/TourDeFlex/TourDeFlex3/src/validators/RegExValidatorExample.mxml +++ /dev/null @@ -1,85 +0,0 @@ -<?xml version="1.0"?> -<!-- - Licensed to the Apache Software Foundation (ASF) under one or more - contributor license agreements. See the NOTICE file distributed with - this work for additional information regarding copyright ownership. - The ASF licenses this file to You under the Apache License, Version 2.0 - (the "License"); you may not use this file except in compliance with - the License. You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. - --> - -<!-- Simple example to demonstrate the RegExpValidator. --> -<mx:Application xmlns:fx="http://ns.adobe.com/mxml/2009" xmlns:mx="library://ns.adobe.com/flex/mx"> - - <fx:Script> - <![CDATA[ - import mx.events.ValidationResultEvent; - import mx.validators.*; - - // Write the results to the - private function handleResult(eventObj:ValidationResultEvent):void { - if (eventObj.type == ValidationResultEvent.VALID) - { - // For valid events, the results Array contains - // RegExpValidationResult objects. - var xResult:RegExpValidationResult; - reResults.text=""; - for (var i:uint = 0; i < eventObj.results.length; i++) - { - xResult = eventObj.results[i]; - reResults.text=reResults.text + xResult.matchedIndex + " " + - xResult.matchedString + "\n"; - } - } - else - { - reResults.text=""; - } - } - ]]> - </fx:Script> - - <fx:Declarations> - <mx:RegExpValidator id="regExpV" - source="{regex_text}" property="text" - flags="g" expression="{regex.text}" - valid="handleResult(event)" invalid="handleResult(event)" - trigger="{myButton}" triggerEvent="click"/> - </fx:Declarations> - - <mx:Panel title="RegExpValidator Example" width="95%" height="95%" - paddingTop="5" paddingLeft="5" paddingRight="5" paddingBottom="5"> - - <mx:Text width="100%" text="Instructions:"/> - <mx:Text width="100%" text="1. Enter text to search. By default, enter a string containing the letters ABC in sequence followed by any digit."/> - <mx:Text width="100%" text="2. Enter the regular expression. By default, enter ABC\d."/> - <mx:Text width="100%" text="3. Click the Button control to trigger the validation."/> - <mx:Text width="100%" text="4. The results show the index in the text where the matching pattern begins, and the matching pattern. "/> - - <mx:Form> - <mx:FormItem label="Enter text: "> - <mx:TextInput id="regex_text" text="xxxxABC4xxx" width="100%"/> - </mx:FormItem> - - <mx:FormItem label="Enter regular expression: "> - <mx:TextInput id="regex" text="ABC\d" width="100%"/> - </mx:FormItem> - - <mx:FormItem label="Results: "> - <mx:TextInput id="reResults" width="100%"/> - </mx:FormItem> - - <mx:FormItem > - <mx:Button id="myButton" label="Validate"/> - </mx:FormItem> - </mx:Form> - </mx:Panel> -</mx:Application> \ No newline at end of file http://git-wip-us.apache.org/repos/asf/flex-utilities/blob/48f47e61/TourDeFlex/TourDeFlex3/src/validators/SimpleValidatorExample.mxml ---------------------------------------------------------------------- diff --git a/TourDeFlex/TourDeFlex3/src/validators/SimpleValidatorExample.mxml b/TourDeFlex/TourDeFlex3/src/validators/SimpleValidatorExample.mxml deleted file mode 100755 index e7c5210..0000000 --- a/TourDeFlex/TourDeFlex3/src/validators/SimpleValidatorExample.mxml +++ /dev/null @@ -1,76 +0,0 @@ -<?xml version="1.0"?> -<!-- - Licensed to the Apache Software Foundation (ASF) under one or more - contributor license agreements. See the NOTICE file distributed with - this work for additional information regarding copyright ownership. - The ASF licenses this file to You under the Apache License, Version 2.0 - (the "License"); you may not use this file except in compliance with - the License. You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. - --> - -<!-- Simple example to demonstrate the Validator class. --> -<mx:Application xmlns:fx="http://ns.adobe.com/mxml/2009" xmlns:mx="library://ns.adobe.com/flex/mx"> - - <fx:Script> - <![CDATA[ - - // Import necessary classes. - import mx.controls.Alert; - import mx.events.ValidationResultEvent; - - // Event listener for the valid and invalid events. - private function handleValid(eventObj:ValidationResultEvent):void { - if(eventObj.type==ValidationResultEvent.VALID) - // Enable Submit button. - submitButton.enabled = true; - else - submitButton.enabled = false; - } - - // Submit form is everything is valid. - private function submitForm():void { - Alert.show("Form Submitted!"); - } - - ]]> - </fx:Script> - - <!-- The Validator class defines the required property and the validator events - used by all validator subclasses. --> - <fx:Declarations> - <mx:Validator id="reqValid" required="true" - source="{fname}" property="text" - valid="handleValid(event)" invalid="handleValid(event)"/> - </fx:Declarations> - - <mx:Panel title="Validator Example" width="100%" height="100%" - paddingTop="5" paddingLeft="5" paddingRight="5" paddingBottom="5"> - - <mx:Form> - <mx:Text width="100%" color="blue" - text="Enter a value in the Name field before you can submit. The E-mail field is optional."/> - - <mx:FormItem label="Name: " required="true"> - <mx:TextInput id="fname" width="100%"/> - </mx:FormItem> - - <mx:FormItem label="E-mail address: " required="false"> - <mx:TextInput id="email" width="100%"/> - </mx:FormItem> - - <mx:FormItem> - <mx:Button id="submitButton" enabled="false" - label="Submit" click="submitForm();"/> - </mx:FormItem> - </mx:Form> - - </mx:Panel> -</mx:Application> \ No newline at end of file http://git-wip-us.apache.org/repos/asf/flex-utilities/blob/48f47e61/TourDeFlex/TourDeFlex3/src/validators/SocialSecurityValidatorExample.mxml ---------------------------------------------------------------------- diff --git a/TourDeFlex/TourDeFlex3/src/validators/SocialSecurityValidatorExample.mxml b/TourDeFlex/TourDeFlex3/src/validators/SocialSecurityValidatorExample.mxml deleted file mode 100755 index b9db3c9..0000000 --- a/TourDeFlex/TourDeFlex3/src/validators/SocialSecurityValidatorExample.mxml +++ /dev/null @@ -1,45 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> -<!-- - Licensed to the Apache Software Foundation (ASF) under one or more - contributor license agreements. See the NOTICE file distributed with - this work for additional information regarding copyright ownership. - The ASF licenses this file to You under the Apache License, Version 2.0 - (the "License"); you may not use this file except in compliance with - the License. You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. - --> - -<!-- Simple example to demonstrate SocialSecurityValidator. --> -<mx:Application xmlns:fx="http://ns.adobe.com/mxml/2009" xmlns:mx="library://ns.adobe.com/flex/mx"> - - <fx:Script> - import mx.controls.Alert; - </fx:Script> - - <fx:Declarations> - <mx:SocialSecurityValidator source="{ssn}" property="text" - trigger="{myButton}" triggerEvent="click" - valid="Alert.show('Validation Succeeded!');"/> - </fx:Declarations> - - <mx:Panel title="Social Security Validator Panel" width="75%" height="75%" - paddingTop="10" paddingLeft="10" paddingRight="10" paddingBottom="10"> - - <mx:Form> - <mx:FormItem label="Enter Social Security number: "> - <mx:TextInput id="ssn" width="100%"/> - </mx:FormItem> - - <mx:FormItem > - <mx:Button id="myButton" label="Validate" /> - </mx:FormItem> - </mx:Form> - </mx:Panel> -</mx:Application> \ No newline at end of file http://git-wip-us.apache.org/repos/asf/flex-utilities/blob/48f47e61/TourDeFlex/TourDeFlex3/src/validators/StringValidatorExample.mxml ---------------------------------------------------------------------- diff --git a/TourDeFlex/TourDeFlex3/src/validators/StringValidatorExample.mxml b/TourDeFlex/TourDeFlex3/src/validators/StringValidatorExample.mxml deleted file mode 100755 index 8e28f64..0000000 --- a/TourDeFlex/TourDeFlex3/src/validators/StringValidatorExample.mxml +++ /dev/null @@ -1,48 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> -<!-- - Licensed to the Apache Software Foundation (ASF) under one or more - contributor license agreements. See the NOTICE file distributed with - this work for additional information regarding copyright ownership. - The ASF licenses this file to You under the Apache License, Version 2.0 - (the "License"); you may not use this file except in compliance with - the License. You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. - --> - -<!-- Simple example to demonstrate StringValidator. --> -<mx:Application xmlns:fx="http://ns.adobe.com/mxml/2009" xmlns:mx="library://ns.adobe.com/flex/mx"> - - <fx:Script> - import mx.controls.Alert; - </fx:Script> - - <fx:Declarations> - <mx:StringValidator source="{fname}" property="text" - tooShortError="This string is shorter than the minimum allowed length of 4. " - tooLongError="This string is longer than the maximum allowed length of 20." - minLength="4" maxLength="20" - trigger="{myButton}" triggerEvent="click" - valid="Alert.show('Validation Succeeded!');"/> - </fx:Declarations> - - <mx:Panel title="StringValidator Example" width="75%" height="75%" - paddingTop="10" paddingLeft="10" paddingRight="10" paddingBottom="10"> - - <mx:Form> - <mx:FormItem label="Enter a name between 4 and 20 characters: "> - <mx:TextInput id="fname" width="100%"/> - </mx:FormItem> - - <mx:FormItem > - <mx:Button id="myButton" label="Validate" /> - </mx:FormItem> - </mx:Form> - </mx:Panel> -</mx:Application> \ No newline at end of file http://git-wip-us.apache.org/repos/asf/flex-utilities/blob/48f47e61/TourDeFlex/TourDeFlex3/src/validators/ZipCodeValidatorExample.mxml ---------------------------------------------------------------------- diff --git a/TourDeFlex/TourDeFlex3/src/validators/ZipCodeValidatorExample.mxml b/TourDeFlex/TourDeFlex3/src/validators/ZipCodeValidatorExample.mxml deleted file mode 100755 index 5d874af..0000000 --- a/TourDeFlex/TourDeFlex3/src/validators/ZipCodeValidatorExample.mxml +++ /dev/null @@ -1,45 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> -<!-- - Licensed to the Apache Software Foundation (ASF) under one or more - contributor license agreements. See the NOTICE file distributed with - this work for additional information regarding copyright ownership. - The ASF licenses this file to You under the Apache License, Version 2.0 - (the "License"); you may not use this file except in compliance with - the License. You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. - --> - -<!-- Simple example to demonstrate the ZipCodeValidator. --> -<mx:Application xmlns:fx="http://ns.adobe.com/mxml/2009" xmlns:mx="library://ns.adobe.com/flex/mx"> - - <fx:Script> - import mx.controls.Alert; - </fx:Script> - - <fx:Declarations> - <mx:ZipCodeValidator source="{zip}" property="text" - trigger="{myButton}" triggerEvent="click" - valid="Alert.show('Validation Succeeded!');"/> - </fx:Declarations> - - <mx:Panel title="ZipcodeValidator Example" width="75%" height="75%" - paddingTop="10" paddingLeft="10" paddingRight="10" paddingBottom="10"> - - <mx:Form> - <mx:FormItem label="Enter a 5 or 9 digit U.S. Zip code: "> - <mx:TextInput id="zip" width="100%"/> - </mx:FormItem> - - <mx:FormItem > - <mx:Button id="myButton" label="Validate" /> - </mx:FormItem> - </mx:Form> - </mx:Panel> -</mx:Application> \ No newline at end of file