royale-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From carlosrov...@apache.org
Subject [royale-asjs] branch develop updated: update Restric doc and add an example
Date Tue, 30 Oct 2018 00:03:12 GMT
This is an automated email from the ASF dual-hosted git repository.

carlosrovira 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 9a8ac41  update Restric doc and add an example
9a8ac41 is described below

commit 9a8ac419e5da075628266f2b04c1f52ba1ece2b1
Author: Carlos Rovira <carlosrovira@apache.org>
AuthorDate: Tue Oct 30 01:03:03 2018 +0100

    update Restric doc and add an example
---
 .../JewelExample/src/main/royale/TextInputPlayGround.mxml   |  8 +++++++-
 .../royale/jewel/beads/controls/textinput/Restrict.as       | 13 ++++---------
 2 files changed, 11 insertions(+), 10 deletions(-)

diff --git a/examples/royale/JewelExample/src/main/royale/TextInputPlayGround.mxml b/examples/royale/JewelExample/src/main/royale/TextInputPlayGround.mxml
index 6d46f90..031efb8 100644
--- a/examples/royale/JewelExample/src/main/royale/TextInputPlayGround.mxml
+++ b/examples/royale/JewelExample/src/main/royale/TextInputPlayGround.mxml
@@ -115,10 +115,16 @@ limitations under the License.
 					</j:TextInput>
 					<j:TextInput>
 						<js:beads>
-							<j:TextPrompt prompt="Only Numbers"/>
+							<j:TextPrompt prompt="Only numbers"/>
 							<j:Restrict pattern="[^0-9]"/>
 						</js:beads>
 					</j:TextInput>
+					<j:TextInput>
+						<js:beads>
+							<j:TextPrompt prompt="Only letters and numbers"/>
+							<j:Restrict pattern="[^0-9a-zA-Z]"/>
+						</js:beads>
+					</j:TextInput>
 				</j:VGroup>
 			</j:Card>
 		</j:GridCell>
diff --git a/frameworks/projects/Jewel/src/main/royale/org/apache/royale/jewel/beads/controls/textinput/Restrict.as
b/frameworks/projects/Jewel/src/main/royale/org/apache/royale/jewel/beads/controls/textinput/Restrict.as
index 160e6f4..e1662dc 100644
--- a/frameworks/projects/Jewel/src/main/royale/org/apache/royale/jewel/beads/controls/textinput/Restrict.as
+++ b/frameworks/projects/Jewel/src/main/royale/org/apache/royale/jewel/beads/controls/textinput/Restrict.as
@@ -41,15 +41,10 @@ package org.apache.royale.jewel.beads.controls.textinput
 	 *  any Jewel TextInputBase control. The bead uses a reg exp pattern to validate
 	 *  input from user. A text property allows to configure error text.
 	 *  
-	 *  use examples:
-	 *  Numeric pattern = -?[0-9]*(\.[0-9]+)?
-	 *  error text = "Input is not a number!"
-	 *
-	 *  Letters and spaces only pattern = [A-Z,a-z, ]*
-	 *  error text = "Letters and spaces only";
-	 *
-	 *  Digits only = [0-9]*
-	 *  error text = "Digits only";
+	 *  pattern examples:
+	 *  Numeric ony pattern = [^0-9]
+	 *  Letters only pattern = [^a-zA-Z]
+	 *  Numeric and letters only pattern = [^0-9a-zA-Z]
 	 *  
 	 *  @langversion 3.0
 	 *  @playerversion Flash 10.2


Mime
View raw message