changeset 2514:902526c9efd4

More input checks with kmspinner. flys-client/trunk@4372 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author Felix Wolfsteller <felix.wolfsteller@intevation.de>
date Wed, 09 May 2012 22:01:50 +0000 (2012-05-09)
parents 89814cc6e922
children 532c590beb3e
files flys-client/ChangeLog flys-client/src/main/java/de/intevation/flys/client/client/ui/chart/CrossSectionChartThemePanel.java
diffstat 2 files changed, 15 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/flys-client/ChangeLog	Wed May 09 21:44:54 2012 +0000
+++ b/flys-client/ChangeLog	Wed May 09 22:01:50 2012 +0000
@@ -1,3 +1,8 @@
+2012-05-09	Felix Wolfsteller	<felix.wolfsteller@intevation.de>
+
+	* src/main/java/de/intevation/flys/client/client/ui/chart/CrossSectionChartThemePanel.java:
+	  Further input checking in kmspinner.
+
 2012-05-09	Felix Wolfsteller	<felix.wolfsteller@intevation.de>
 
 	issue652: Empty spinner leads to exception.
--- a/flys-client/src/main/java/de/intevation/flys/client/client/ui/chart/CrossSectionChartThemePanel.java	Wed May 09 21:44:54 2012 +0000
+++ b/flys-client/src/main/java/de/intevation/flys/client/client/ui/chart/CrossSectionChartThemePanel.java	Wed May 09 22:01:50 2012 +0000
@@ -601,10 +601,16 @@
             kmField.addBlurHandler(new BlurHandler() {
                 @Override
                 public void onBlur(BlurEvent be) {
-                    if(kmField.getValue() != null)
-                    spinnerValueEntered(null,
-                        Double.parseDouble(kmField.getValue().toString()),
-                        _facetRecord);
+                    if (kmField.getValue() != null) {
+                        try {
+                            spinnerValueEntered(null,
+                                Double.parseDouble(kmField.getValue().toString()),
+                                _facetRecord);
+                        }
+                        catch(NumberFormatException nfe) {
+                            GWT.log("entered string cannot be parsed to double.");
+                        }
+                    }
                 }
             });
             kmField.addKeyPressHandler(new KeyPressHandler(){

http://dive4elements.wald.intevation.org