changeset 9290:3729434f6dec

UD/Q verwechselt
author gernotbelger
date Tue, 24 Jul 2018 11:12:46 +0200
parents 82c67b859aa7
children 913bc7d1d2a8
files gwt-client/src/main/java/org/dive4elements/river/client/client/ui/bundu/BunduWstWQPanel.java
diffstat 1 files changed, 11 insertions(+), 9 deletions(-) [+]
line wrap: on
line diff
--- a/gwt-client/src/main/java/org/dive4elements/river/client/client/ui/bundu/BunduWstWQPanel.java	Tue Jul 24 10:39:03 2018 +0200
+++ b/gwt-client/src/main/java/org/dive4elements/river/client/client/ui/bundu/BunduWstWQPanel.java	Tue Jul 24 11:12:46 2018 +0200
@@ -151,9 +151,9 @@
 
                 final String value = e.getValue().toString();
                 if (value.equals(String.valueOf(mode.UD))) {
+                    enableUD();
+                } else if (value.equals(String.valueOf(mode.Q))) {
                     enableQ();
-                } else if (value.equals(String.valueOf(mode.Q))) {
-                    enableUD();
                 }
             }
         });
@@ -161,17 +161,17 @@
     }
 
     private void enableUD() {
+        BunduWstWQPanel.this.list.setVisibility(Visibility.HIDDEN);
+        BunduWstWQPanel.this.udForm.setVisibility(Visibility.VISIBLE);
+        BunduWstWQPanel.this.tabs.disable();
+    }
+
+    private void enableQ() {
         BunduWstWQPanel.this.list.setVisibility(Visibility.VISIBLE);
         BunduWstWQPanel.this.udForm.setVisibility(Visibility.HIDDEN);
         BunduWstWQPanel.this.tabs.enable();
     }
 
-    private void enableQ() {
-        BunduWstWQPanel.this.list.setVisibility(Visibility.HIDDEN);
-        BunduWstWQPanel.this.udForm.setVisibility(Visibility.VISIBLE);
-        BunduWstWQPanel.this.tabs.disable();
-    }
-
     private final String getMode() {
         return (String) this.radiogroup.getValue();
     }
@@ -246,9 +246,11 @@
             errors.addAll(this.validateRange(this.qranges));
         } else if (getMode().equals(mode.UD.toString())) {
             try {
-                if (this.udInputItem.validate()) {
+                if (!this.udInputItem.validate()) {
                     errors.add(this.udInputItem.getRequiredMessage());
                 }
+                final int test = Integer.valueOf(this.udInputItem.getValueAsString());// irgendwie klappt die validator-validierung nur bei der eingabe von
+                                                                                      // ganzzahlen :-(
             }
             catch (final NumberFormatException e) {
                 errors.add(this.MSG.error_invalid_integer());

http://dive4elements.wald.intevation.org