changeset 602:3b670af34367

The adapted WQ panel now displays warnings if no information are present to validate user input. flys-client/trunk@2208 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author Ingo Weinzierl <ingo.weinzierl@intevation.de>
date Wed, 22 Jun 2011 15:11:15 +0000
parents 3cf6ee30207c
children 8cb98fa4987f
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/ui/WQAdaptedInputPanel.java
diffstat 3 files changed, 34 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/flys-client/ChangeLog	Wed Jun 22 14:02:11 2011 +0000
+++ b/flys-client/ChangeLog	Wed Jun 22 15:11:15 2011 +0000
@@ -1,3 +1,12 @@
+2011-06-22  Ingo Weinzierl <ingo@intevation.de>
+
+	* src/main/java/de/intevation/flys/client/client/FLYSConstants.java:
+	  Added a new error string.
+
+	* src/main/java/de/intevation/flys/client/client/ui/WQAdaptedInputPanel.java:
+	  Display a warning if there are no information of W and Q ranges that
+	  might be used to validate user input.
+
 2011-06-22  Ingo Weinzierl <ingo@intevation.de>
 
 	* src/main/java/de/intevation/flys/client/client/ui/CollectionView.java:
--- a/flys-client/src/main/java/de/intevation/flys/client/client/FLYSConstants.java	Wed Jun 22 14:02:11 2011 +0000
+++ b/flys-client/src/main/java/de/intevation/flys/client/client/FLYSConstants.java	Wed Jun 22 15:11:15 2011 +0000
@@ -264,6 +264,8 @@
 
     String error_chart_info_service();
 
+    String error_invalid_double_value();
+
     String bottom_edge();
 
     String top_edge();
--- a/flys-client/src/main/java/de/intevation/flys/client/client/ui/WQAdaptedInputPanel.java	Wed Jun 22 14:02:11 2011 +0000
+++ b/flys-client/src/main/java/de/intevation/flys/client/client/ui/WQAdaptedInputPanel.java	Wed Jun 22 15:11:15 2011 +0000
@@ -12,6 +12,7 @@
 
 import com.smartgwt.client.types.TitleOrientation;
 import com.smartgwt.client.types.VerticalAlignment;
+import com.smartgwt.client.util.SC;
 import com.smartgwt.client.widgets.Canvas;
 import com.smartgwt.client.widgets.Label;
 import com.smartgwt.client.widgets.form.DynamicForm;
@@ -222,7 +223,17 @@
 
             String           key = iter.next();
             DoubleArrayPanel dap = wqranges.get(key);
-            double[]         mm  = wranges.get(key);
+
+            if (!dap.validateForm()) {
+                errors.add(MSG.error_invalid_double_value());
+                return errors;
+            }
+
+            double[] mm  = wranges.get(key);
+            if (mm == null) {
+                SC.warn(MSG.error_read_minmax_values());
+                continue;
+            }
 
             double[] values = dap.getInputValues();
             double[] good   = new double[values.length];
@@ -269,7 +280,17 @@
 
             String           key = iter.next();
             DoubleArrayPanel dap = wqranges.get(key);
-            double[]         mm  = qranges.get(key);
+
+            if (!dap.validateForm()) {
+                errors.add(MSG.error_invalid_double_value());
+                return errors;
+            }
+
+            double[] mm = qranges.get(key);
+            if (mm == null) {
+                SC.warn(MSG.error_read_minmax_values());
+                continue;
+            }
 
             double[] values = dap.getInputValues();
             double[] good   = new double[values.length];

http://dive4elements.wald.intevation.org