You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@royale.apache.org by pi...@apache.org on 2019/07/16 15:22:46 UTC
[royale-asjs] branch develop updated: CreditCardValidatorExample:
Fix form validation
This is an automated email from the ASF dual-hosted git repository.
piotrz pushed a commit to branch develop
in repository https://gitbox.apache.org/repos/asf/royale-asjs.git
The following commit(s) were added to refs/heads/develop by this push:
new 62ab4a5 CreditCardValidatorExample: Fix form validation
62ab4a5 is described below
commit 62ab4a5d87e0c19aca35e82f9427975accdbed0b
Author: Piotr Zarzycki <pi...@gmail.com>
AuthorDate: Tue Jul 16 17:22:33 2019 +0200
CreditCardValidatorExample: Fix form validation
- Fix Moonshine IDE file
---
.../CreditCardValidatorExample.as3proj | 46 +++++++++++-----------
.../src/main/royale/MainContent.mxml | 13 +++++-
2 files changed, 34 insertions(+), 25 deletions(-)
diff --git a/examples/royale/CreditCardValidatorExample/CreditCardValidatorExample.as3proj b/examples/royale/CreditCardValidatorExample/CreditCardValidatorExample.as3proj
index 9451f6f..7fb60ee 100644
--- a/examples/royale/CreditCardValidatorExample/CreditCardValidatorExample.as3proj
+++ b/examples/royale/CreditCardValidatorExample/CreditCardValidatorExample.as3proj
@@ -41,20 +41,10 @@
</moonshineResourcePaths>
<moonshineNativeExtensionPaths></moonshineNativeExtensionPaths>
<build>
- <option customSDK="D:\Work\royale_ide\royale_nightly_js"/>
- <option loadConfig=""/>
- <option linkReport=""/>
- <option locale=""/>
- <option staticLinkRSL="False"/>
- <option showActionScriptWarnings="True"/>
- <option compilerConstants=""/>
- <option allowSourcePathOverlap="False"/>
- <option showBindingWarnings="True"/>
- <option optimize="False"/>
<option showDeprecationWarnings="True"/>
- <option additional="-theme=${royalelib}/themes/JewelTheme/src/main/resources/defaults.css -html-template=src/main/resources/jewel-index-template.html"/>
+ <option additional="-theme=${royalelib}/themes/JewelTheme/src/main/resources/defaults.css -html-template=src/main/resources/jewel-example-index-template.html"/>
+ <option locale=""/>
<option strict="True"/>
- <option antBuildPath="build/build.xml"/>
<option accessible="False"/>
<option useNetwork="True"/>
<option showUnusedTypeSelectorWarnings="True"/>
@@ -63,17 +53,27 @@
<option warnings="True"/>
<option es="False"/>
<option verboseStackTraces="False"/>
+ <option customSDK="D:\Work\royale_ide\royale_nightly_js"/>
+ <option loadConfig=""/>
+ <option linkReport=""/>
+ <option optimize="False"/>
+ <option staticLinkRSL="False"/>
+ <option showActionScriptWarnings="True"/>
+ <option compilerConstants=""/>
+ <option allowSourcePathOverlap="False"/>
+ <option showBindingWarnings="True"/>
+ <option antBuildPath="build/build.xml"/>
</build>
<mavenBuild>
- <option settingsFilePath=""/>
<option mavenBuildPath=""/>
+ <option settingsFilePath=""/>
<option commandLine=""/>
<actions>
- <action actionName="Build" action="install"/>
- <action actionName="Clean and package" action="clean package"/>
- <action actionName="Clean" action="clean"/>
- <action actionName="Clean and Build" action="clean install"/>
- <action actionName="Exploded" action="war:exploded"/>
+ <action action="install" actionName="Build"/>
+ <action action="clean package" actionName="Clean and package"/>
+ <action action="clean" actionName="Clean"/>
+ <action action="clean install" actionName="Clean and Build"/>
+ <action action="war:exploded" actionName="Exploded"/>
</actions>
</mavenBuild>
<includeLibraries></includeLibraries>
@@ -94,22 +94,22 @@
<postBuildCommand alwaysRun="False">null</postBuildCommand>
<trustSVNCertificate>False</trustSVNCertificate>
<options>
- <option isRoyale="True"/>
<option showHiddenPaths="False"/>
- <option testMovie=""/>
+ <option isPrimeFacesVisualEditor="False"/>
<option testMovieCommand=""/>
<option isExportedToExistingSource="False"/>
<option defaultBuildTargets=""/>
<option visualEditorExportPath=""/>
- <option isPrimeFacesVisualEditor="False"/>
+ <option testMovie=""/>
+ <option isRoyale="True"/>
</options>
<moonshineRunCustomization>
- <option targetPlatform="2"/>
+ <option launchMethod="Simulator"/>
<option urlToLaunch=""/>
<option customUrlToLaunch=""/>
+ <option targetPlatform="2"/>
<option deviceSimulator="null"/>
<option projectType="2"/>
- <option launchMethod="Simulator"/>
<deviceSimulator>null</deviceSimulator>
<certAndroid>null</certAndroid>
<certIos>null</certIos>
diff --git a/examples/royale/CreditCardValidatorExample/src/main/royale/MainContent.mxml b/examples/royale/CreditCardValidatorExample/src/main/royale/MainContent.mxml
index 4074dcc..ab7590e 100644
--- a/examples/royale/CreditCardValidatorExample/src/main/royale/MainContent.mxml
+++ b/examples/royale/CreditCardValidatorExample/src/main/royale/MainContent.mxml
@@ -22,17 +22,26 @@
xmlns:js="library://ns.apache.org/royale/basic"
xmlns:html="library://ns.apache.org/royale/html"
initComplete="onInit(event)">
+ <j:beads>
+ <js:ContainerDataBinding />
+ </j:beads>
<fx:Script>
<![CDATA[
import org.apache.royale.collections.ArrayList;
+ import org.apache.royale.jewel.Alert;
private function onInit(event:Event):void
{
creditCardType.dataProvider = new ArrayList(["American Express", "Discover", "MasterCard", "Visa"]);
}
+
+ private function onFormValid(event:Event):void
+ {
+ Alert.show("Credit Card is valid!");
+ }
]]>
</fx:Script>
- <j:Form>
+ <j:Form valid="onFormValid(event)">
<j:beads>
<j:FormValidator trigger="{btnSubmit}" triggerEvent="click"
requiredFieldError="There are invalid data, please check it."/>
@@ -68,7 +77,7 @@
</j:TextInput>
</j:FormItem>
<j:FormItem>
- <j:Button localId="btnSubmit"/>
+ <j:Button localId="btnSubmit" text="Submit"/>
</j:FormItem>
</j:Form>
</j:ApplicationResponsiveView>