[Dive4elements-commits] [PATCH] issue1261: when tab is created, jump navi to 'default'-km. This overcomes

Wald Commits scm-commit at wald.intevation.org
Tue May 14 16:42:45 CEST 2013


# HG changeset patch
# User Felix Wolfsteller <felix.wolfsteller at intevation.de>
# Date 1368519089 -7200
# Node ID bcaf66443b9313ba6c5df6514d84f35f3ec97de6
# Parent  d24d29d9efa7a43552bc699ad8cc2e8f10cc48ae
issue1261: when tab is created, jump navi to 'default'-km. This overcomes
the issue that when editing a project (esp. range), the old value is remembered.

diff -r d24d29d9efa7 -r bcaf66443b93 gwt-client/src/main/java/org/dive4elements/river/client/client/ui/chart/NaviChartOutputTab.java
--- a/gwt-client/src/main/java/org/dive4elements/river/client/client/ui/chart/NaviChartOutputTab.java	Tue May 14 07:53:51 2013 +0200
+++ b/gwt-client/src/main/java/org/dive4elements/river/client/client/ui/chart/NaviChartOutputTab.java	Tue May 14 10:11:29 2013 +0200
@@ -137,24 +137,15 @@
         collectionView.setMaxKm(toKm);
 
         final NumberFormat nf = NumberFormat.getDecimalFormat();
-        if (collectionView.getCurrentKm() == -1d) {
-            try {
-                double d = Double.valueOf(fromKm);
-                currentkm.setValue(nf.format(d));
-            } catch (NumberFormatException e) {
-                currentkm.setValue(fromKm);
-            }
-            collectionView.setCurrentKm(fromKm);
+
+        // Always jump to the from km when initialized.
+        try {
+            double d = Double.valueOf(fromKm);
+            currentkm.setValue(nf.format(d));
+        } catch (NumberFormatException e) {
+            currentkm.setValue(fromKm);
         }
-        else {
-            try {
-                double d = Double.valueOf(fromKm);
-                currentkm.setValue(nf.format(d));
-            } catch (NumberFormatException e) {
-                currentkm.setValue(fromKm);
-            }
-            currentkm.setValue(collectionView.getCurrentKm());
-        }
+        collectionView.setCurrentKm(fromKm);
 
         lower.addClickHandler(new ClickHandler() {
             public void onClick(ClickEvent ce) {


More information about the Dive4elements-commits mailing list