You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@isis.apache.org by da...@apache.org on 2021/10/02 15:57:36 UTC

[isis-app-demo] 01/03: updates PhoneNumber with regex pattern.

This is an automated email from the ASF dual-hosted git repository.

danhaywood pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/isis-app-demo.git

commit 71c5e4329840c47d68a201c3ec5fd3f2bf78b665
Author: Dan Haywood <da...@haywood-associates.co.uk>
AuthorDate: Sat Oct 2 16:55:14 2021 +0100

    updates PhoneNumber with regex pattern.
---
 .../src/main/java/petclinic/modules/pets/types/PhoneNumber.java     | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/module-pets/src/main/java/petclinic/modules/pets/types/PhoneNumber.java b/module-pets/src/main/java/petclinic/modules/pets/types/PhoneNumber.java
index 711fe6f..33821cf 100644
--- a/module-pets/src/main/java/petclinic/modules/pets/types/PhoneNumber.java
+++ b/module-pets/src/main/java/petclinic/modules/pets/types/PhoneNumber.java
@@ -15,7 +15,11 @@ import org.apache.isis.applib.annotation.PropertyLayout;
 @Property(
         editing = Editing.ENABLED,
         maxLength = PhoneNumber.MAX_LEN,
-        optionality = Optionality.OPTIONAL
+        optionality = Optionality.OPTIONAL,
+        regexPattern = "[+]?[0-9 ]+",
+        regexPatternReplacement =
+                "Specify only numbers and spaces, optionally prefixed with '+'.  " +
+                        "For example, '+353 1 555 1234', or '07123 456789'"
 )
 @Parameter(maxLength = PhoneNumber.MAX_LEN, optionality = Optionality.OPTIONAL)
 @Target({ ElementType.METHOD, ElementType.FIELD, ElementType.PARAMETER, ElementType.ANNOTATION_TYPE })