changeset 637:154d158238d3

Display the selected value if there is no description avaible. WKT-strings will be displayed again (issue182). gnv-artifacts/trunk@720 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author Ingo Weinzierl <ingo.weinzierl@intevation.de>
date Mon, 01 Mar 2010 16:00:39 +0000
parents 22cc12b1622c
children c580666a843f
files gnv-artifacts/ChangeLog gnv-artifacts/src/main/java/de/intevation/gnv/state/StateBase.java
diffstat 2 files changed, 13 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/gnv-artifacts/ChangeLog	Mon Mar 01 14:15:33 2010 +0000
+++ b/gnv-artifacts/ChangeLog	Mon Mar 01 16:00:39 2010 +0000
@@ -1,3 +1,11 @@
+2010-03-01  Ingo Weinzierl <ingo.weinzierl@intevation.de>
+
+	  Issue182
+
+	* src/main/java/de/intevation/gnv/state/StateBase.java: Display the selected
+	  value if there is no description available. WKT-strings will be displayed
+	  in the static ui part again.
+
 2010-03-01  Ingo Weinzierl <ingo.weinzierl@intevation.de>
 
 	  Issue179
--- a/gnv-artifacts/src/main/java/de/intevation/gnv/state/StateBase.java	Mon Mar 01 14:15:33 2010 +0000
+++ b/gnv-artifacts/src/main/java/de/intevation/gnv/state/StateBase.java	Mon Mar 01 16:00:39 2010 +0000
@@ -714,15 +714,18 @@
 
         for (int i = 0; i < size; i++) {
             Element itemNode = creator.create("item");
+            String value = data.getValue();
+            String desc  = descriptions[i];
+            desc = desc == null ? value : desc;
 
             creator.addAttr(itemNode, "selected", "true");
 
             Element choiceLableNode = creator.create("label");
-            choiceLableNode.setTextContent(descriptions[i]);
+            choiceLableNode.setTextContent(desc);
             itemNode.appendChild(choiceLableNode);
 
             Element choiceValueNode = creator.create("value");
-            choiceValueNode.setTextContent(data.getValue());
+            choiceValueNode.setTextContent(value);
             itemNode.appendChild(choiceValueNode);
             choiceNode.appendChild(itemNode);
         }

http://dive4elements.wald.intevation.org