changeset 874:d900ab031dfe

Set the default value of the AutoInteger panel to 'auto' if no other value is set. flys-client/trunk@2698 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author Ingo Weinzierl <ingo.weinzierl@intevation.de>
date Mon, 12 Sep 2011 09:39:15 +0000 (2011-09-12)
parents 77a549772aa9
children a77958780e1c
files flys-client/ChangeLog flys-client/src/main/java/de/intevation/flys/client/client/ui/AutoIntegerPanel.java
diffstat 2 files changed, 21 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/flys-client/ChangeLog	Mon Sep 12 05:40:58 2011 +0000
+++ b/flys-client/ChangeLog	Mon Sep 12 09:39:15 2011 +0000
@@ -1,3 +1,10 @@
+2011-09-12  Ingo Weinzierl <ingo@intevation.de>
+
+	flys/issue282 (Karte: Abstand interpolierte Profile - Default wert)
+
+	* src/main/java/de/intevation/flys/client/client/ui/AutoIntegerPanel.java:
+	  Set default value (if no other value is set) to 'auto'.
+
 2011-09-12  Ingo Weinzierl <ingo@intevation.de>
 
 	* src/main/java/de/intevation/flys/client/client/ui/AbstractUIProvider.java:
--- a/flys-client/src/main/java/de/intevation/flys/client/client/ui/AutoIntegerPanel.java	Mon Sep 12 05:40:58 2011 +0000
+++ b/flys-client/src/main/java/de/intevation/flys/client/client/ui/AutoIntegerPanel.java	Mon Sep 12 09:39:15 2011 +0000
@@ -21,6 +21,8 @@
 
     public static final String FIELD_NAME = "integer_field";
 
+    public static final String FIELD_DEFAULT_VALUE = "auto";
+
 
     protected static FLYSConstants MSG = GWT.create(FLYSConstants.class);
 
@@ -51,6 +53,18 @@
     }
 
 
+    @Override
+    protected void initDefaultValues(DataList dataList) {
+        super.initDefaultValues(dataList);
+
+        String def = getValueAsString();
+
+        if (def == null || def.length() == 0) {
+            form.setValue(getFieldName(), FIELD_DEFAULT_VALUE);
+        }
+    }
+
+
     protected String getTitle() {
         return MSG.uesk_profile_distance();
     }

http://dive4elements.wald.intevation.org