changeset 907:24d15c2e0da3

Validate than the input field for single locations contains a single value. (Issue199) flys-client/trunk@2763 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author Raimund Renkert <raimund.renkert@intevation.de>
date Thu, 15 Sep 2011 15:28:31 +0000
parents 39acba4b5f0b
children a680ccec5dd6
files flys-client/ChangeLog flys-client/src/main/java/de/intevation/flys/client/client/FLYSConstants.java flys-client/src/main/java/de/intevation/flys/client/client/FLYSConstants.properties flys-client/src/main/java/de/intevation/flys/client/client/FLYSConstants_de.properties flys-client/src/main/java/de/intevation/flys/client/client/FLYSConstants_en.properties flys-client/src/main/java/de/intevation/flys/client/client/ui/SingleLocationPanel.java
diffstat 6 files changed, 23 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/flys-client/ChangeLog	Thu Sep 15 14:48:31 2011 +0000
+++ b/flys-client/ChangeLog	Thu Sep 15 15:28:31 2011 +0000
@@ -1,3 +1,16 @@
+2011-09-15  Raimund Renkert <raimund.renkert@intevation.de>
+
+	Issue199
+
+	* src/main/java/de/intevation/flys/client/client/ui/SingleLocationPanel.java:
+	  Validate than the input field contains a single value.
+
+	* src/main/java/de/intevation/flys/client/client/FLYSConstants_en.properties,
+	  src/main/java/de/intevation/flys/client/client/FLYSConstants.java,
+	  src/main/java/de/intevation/flys/client/client/FLYSConstants.properties,
+	  src/main/java/de/intevation/flys/client/client/FLYSConstants_de.properties:
+	  Added i18n string for error message.
+
 2011-09-15  Raimund Renkert <raimund.renkert@intevation.de>
 
 	Issue200
--- a/flys-client/src/main/java/de/intevation/flys/client/client/FLYSConstants.java	Thu Sep 15 14:48:31 2011 +0000
+++ b/flys-client/src/main/java/de/intevation/flys/client/client/FLYSConstants.java	Thu Sep 15 15:28:31 2011 +0000
@@ -160,6 +160,8 @@
 
     String wrongFormat();
 
+    String too_many_values ();
+
     String description();
 
     String from();
--- a/flys-client/src/main/java/de/intevation/flys/client/client/FLYSConstants.properties	Thu Sep 15 14:48:31 2011 +0000
+++ b/flys-client/src/main/java/de/intevation/flys/client/client/FLYSConstants.properties	Thu Sep 15 15:28:31 2011 +0000
@@ -68,6 +68,7 @@
 unitDiffInM = Diff [m]:
 unitLocation = km
 wrongFormat = Wrong format
+too_many_values = Only one value allowed
 description = Description
 from = From
 to = To
--- a/flys-client/src/main/java/de/intevation/flys/client/client/FLYSConstants_de.properties	Thu Sep 15 14:48:31 2011 +0000
+++ b/flys-client/src/main/java/de/intevation/flys/client/client/FLYSConstants_de.properties	Thu Sep 15 15:28:31 2011 +0000
@@ -68,6 +68,8 @@
 unitDiffInM = Diff [m]:
 unitLocation = km
 wrongFormat = Falsches Format
+too_many_values = Nur ein Eingabewert erlaubt
+
 description = Beschreibung
 from = von
 to = bis
--- a/flys-client/src/main/java/de/intevation/flys/client/client/FLYSConstants_en.properties	Thu Sep 15 14:48:31 2011 +0000
+++ b/flys-client/src/main/java/de/intevation/flys/client/client/FLYSConstants_en.properties	Thu Sep 15 15:28:31 2011 +0000
@@ -65,6 +65,7 @@
 
 unitLocation = km
 wrongFormat = Wrong format
+too_many_values = Only one value allowed
 description = Description
 from = From
 to = To
--- a/flys-client/src/main/java/de/intevation/flys/client/client/ui/SingleLocationPanel.java	Thu Sep 15 14:48:31 2011 +0000
+++ b/flys-client/src/main/java/de/intevation/flys/client/client/ui/SingleLocationPanel.java	Thu Sep 15 15:28:31 2011 +0000
@@ -343,6 +343,10 @@
         double[] good   = new double[values.length];
         int      idx    = 0;
 
+        if (values.length > 1) {
+            errors.add(MESSAGES.too_many_values());
+        }
+
         for (double value: values) {
             if (value < min || value > max) {
                 String tmp = MESSAGES.error_validate_range();

http://dive4elements.wald.intevation.org