changeset 4567:5e6e89f19a37

flys/client: Exception catched and replaced by friendly warning (MINFO Sohlhoehendifferenz) #967/flys.
author Christian Lins <christian.lins@intevation.de>
date Sun, 18 Nov 2012 01:19:07 +0100
parents 1784ef23e29e
children bbd82bd8e541
files 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/DatacagePairWidget.java
diffstat 5 files changed, 16 insertions(+), 12 deletions(-) [+]
line wrap: on
line diff
--- a/flys-client/src/main/java/de/intevation/flys/client/client/FLYSConstants.java	Fri Nov 16 18:35:08 2012 +0100
+++ b/flys-client/src/main/java/de/intevation/flys/client/client/FLYSConstants.java	Sun Nov 18 01:19:07 2012 +0100
@@ -668,6 +668,8 @@
 
     String warning_use_first_feature();
 
+    String warning_select_two_values();
+
     String error_no_valid_gfi_url();
 
     String error_gfi_req_failed();
--- a/flys-client/src/main/java/de/intevation/flys/client/client/FLYSConstants.properties	Fri Nov 16 18:35:08 2012 +0100
+++ b/flys-client/src/main/java/de/intevation/flys/client/client/FLYSConstants.properties	Sun Nov 18 01:19:07 2012 +0100
@@ -360,6 +360,7 @@
 warning_use_first_feature = You have more that one object selected. The first one is used.
 warning_no_wsp_selected = No waterlevel selected!
 warning_cannot_parse_date = Invalid date!
+warning_select_two_values = Please select two values!
 
 ## map related strings
 digitize = images/digitize.png
--- a/flys-client/src/main/java/de/intevation/flys/client/client/FLYSConstants_de.properties	Fri Nov 16 18:35:08 2012 +0100
+++ b/flys-client/src/main/java/de/intevation/flys/client/client/FLYSConstants_de.properties	Sun Nov 18 01:19:07 2012 +0100
@@ -361,6 +361,7 @@
 warning_use_first_feature = Sie haben mehr als ein Objekt ausgew\u00e4hlt. Das erste Objekt wird benutzt.
 warning_no_wsp_selected = Kein Wasserstand ausgew\u00e4hlt!
 warning_cannot_parse_date = Datum ist ung\u00fcltig!
+warning_select_two_values = Bitte zwei Werte w\u00e4hlen!
 
 ## map related strings
 digitize = images/digitize.png
--- a/flys-client/src/main/java/de/intevation/flys/client/client/FLYSConstants_en.properties	Fri Nov 16 18:35:08 2012 +0100
+++ b/flys-client/src/main/java/de/intevation/flys/client/client/FLYSConstants_en.properties	Sun Nov 18 01:19:07 2012 +0100
@@ -361,6 +361,7 @@
 warning_use_first_feature = You have more that one object selected. The first one is used.
 warning_no_wsp_selected = No waterlevel selected!
 warning_cannot_parse_date = Date is invalid!
+warning_select_two_values = Please select two values!
 
 ## map related strings
 digitize = images/digitize.png
--- a/flys-client/src/main/java/de/intevation/flys/client/client/ui/DatacagePairWidget.java	Fri Nov 16 18:35:08 2012 +0100
+++ b/flys-client/src/main/java/de/intevation/flys/client/client/ui/DatacagePairWidget.java	Sun Nov 18 01:19:07 2012 +0100
@@ -2,21 +2,18 @@
 
 import com.google.gwt.core.client.GWT;
 
+import com.smartgwt.client.util.SC;
 import com.smartgwt.client.widgets.Button;
-
-import com.smartgwt.client.widgets.layout.VLayout;
-import com.smartgwt.client.widgets.layout.HLayout;
-
+import com.smartgwt.client.widgets.events.ClickEvent;
 import com.smartgwt.client.widgets.events.ClickHandler;
-import com.smartgwt.client.widgets.events.ClickEvent;
-
 import com.smartgwt.client.widgets.grid.ListGrid;
-
-import de.intevation.flys.client.shared.model.Artifact;
-import de.intevation.flys.client.shared.model.User;
-import de.intevation.flys.client.shared.model.ToLoad;
+import com.smartgwt.client.widgets.layout.HLayout;
+import com.smartgwt.client.widgets.layout.VLayout;
 
 import de.intevation.flys.client.client.FLYSConstants;
+import de.intevation.flys.client.shared.model.Artifact;
+import de.intevation.flys.client.shared.model.ToLoad;
+import de.intevation.flys.client.shared.model.User;
 
 
 /**
@@ -95,8 +92,10 @@
         ToLoad toLoad1 = firstDatacageWidget.getSelection();
         ToLoad toLoad2 = secondDatacageWidget.getSelection();
 
-        // TODO further sanitize (toRecommendations.length)
-        if (toLoad1 == null || toLoad2 == null) {
+        if (toLoad1 == null || toLoad2 == null ||
+            toLoad1.toRecommendations().isEmpty() ||
+            toLoad2.toRecommendations().isEmpty()) {
+            SC.say(MSG.warning_select_two_values());
             return;
         }
 

http://dive4elements.wald.intevation.org