changeset 1277:ee55a8ab5f5e

Bugfix: #211 Reset values of km range mode if single km mode is selected and the other way arround. flys-client/trunk@2853 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author Ingo Weinzierl <ingo.weinzierl@intevation.de>
date Wed, 28 Sep 2011 10:48:07 +0000
parents 393e5d37d85d
children 4c3329db2536
files flys-client/ChangeLog flys-client/src/main/java/de/intevation/flys/client/client/ui/LocationDistancePanel.java
diffstat 2 files changed, 35 insertions(+), 24 deletions(-) [+]
line wrap: on
line diff
--- a/flys-client/ChangeLog	Wed Sep 28 10:03:06 2011 +0000
+++ b/flys-client/ChangeLog	Wed Sep 28 10:48:07 2011 +0000
@@ -1,3 +1,11 @@
+2011-09-28  Ingo Weinzierl <ingo@intevation.de>
+
+	flys/issue211 (W-INFO: Wasserspiegellagenberechnung / Auswahlunterstützung Abfluss)
+
+	* src/main/java/de/intevation/flys/client/client/ui/LocationDistancePanel.java:
+	  Reset values of km range mode if single km mode is selected and the
+	  other way arround.
+
 2011-09-28  Ingo Weinzierl <ingo@intevation.de>
 
 	flys/issue119 (W-INFO: Wasserspiegellagenberechnung / Dateneingabe ausserhalb des Wertebereichs)
--- a/flys-client/src/main/java/de/intevation/flys/client/client/ui/LocationDistancePanel.java	Wed Sep 28 10:03:06 2011 +0000
+++ b/flys-client/src/main/java/de/intevation/flys/client/client/ui/LocationDistancePanel.java	Wed Sep 28 10:48:07 2011 +0000
@@ -791,6 +791,8 @@
      * @return the selected/inserted data.
      */
     public Data[] getData() {
+        List<Data> data = new ArrayList<Data>();
+
         // XXX If we have entered a value and click right afterwards on the
         // 'next' button, the BlurEvent is not fired, and the values are not
         // saved. So, we gonna save those values explicitly.
@@ -800,6 +802,19 @@
                 DoubleArrayPanel form = (DoubleArrayPanel) member;
                 saveLocationValues(form);
             }
+
+            Data dLocations = getDataLocations();
+            DataItem dFrom  = new DefaultDataItem("ld_from", "ld_from", "");
+            DataItem dTo    = new DefaultDataItem("ld_to", "ld_to", "");
+            DataItem dStep  = new DefaultDataItem("ld_step", "ld_step", "");
+
+            data.add(dLocations);
+            data.add(new DefaultData(
+                "ld_from", null, null, new DataItem[] { dFrom } ));
+            data.add(new DefaultData(
+                "ld_to", null, null, new DataItem[] { dTo } ));
+            data.add(new DefaultData(
+                "ld_step", null, null, new DataItem[] { dStep } ));
         }
         else {
             Canvas member = container.getMember(0);
@@ -807,34 +822,22 @@
                 DoubleRangePanel form = (DoubleRangePanel) member;
                 saveDistanceValues(form);
             }
-        }
 
-        Data dMode      = getDataMode();
-        Data dLocations = getDataLocations();
-        Data dFrom      = getDataFrom();
-        Data dTo        = getDataTo();
-        Data dStep      = getDataStep();
+            Data dFrom   = getDataFrom();
+            Data dTo     = getDataTo();
+            Data dStep   = getDataStep();
+            DataItem loc = new DefaultDataItem("ld_locations", "ld_locations","");
 
-        List<Data> data = new ArrayList<Data>();
-
-        if (dMode != null) {
-            data.add(dMode);
+            data.add(dFrom);
+            data.add(dTo);
+            data.add(dStep);
+            data.add(new DefaultData(
+                "ld_locations", null, null, new DataItem[] { loc } ));
         }
 
-        if (dLocations != null) {
-            data.add(dLocations);
-        }
-
-        if (dFrom != null) {
-            data.add(dFrom);
-        }
-
-        if (dTo != null) {
-            data.add(dTo);
-        }
-
-        if (dStep != null) {
-            data.add(dStep);
+        Data dMode = getDataMode();
+        if (dMode != null) {
+            data.add(dMode);
         }
 
         return (Data[]) data.toArray(new Data[data.size()]);

http://dive4elements.wald.intevation.org