diff gnv/src/main/java/de/intevation/gnv/action/ChangeOptionsAction.java @ 407:55dae5bb76db

Fixed issue149. Render the chart if there are output modes existing for this state - not if there are further states. TODO: We should check if there is an output mode named 'chart' before rendering a chart. gnv/trunk@583 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author Ingo Weinzierl <ingo.weinzierl@intevation.de>
date Wed, 20 Jan 2010 14:44:39 +0000
parents 416ff31f6273
children b5733f9f386b
line wrap: on
line diff
--- a/gnv/src/main/java/de/intevation/gnv/action/ChangeOptionsAction.java	Wed Jan 20 14:18:32 2010 +0000
+++ b/gnv/src/main/java/de/intevation/gnv/action/ChangeOptionsAction.java	Wed Jan 20 14:44:39 2010 +0000
@@ -5,6 +5,7 @@
 
 import java.util.Collection;
 import java.util.Iterator;
+import java.util.Map;
 
 import javax.servlet.http.HttpServletRequest;
 import javax.servlet.http.HttpServletResponse;
@@ -68,6 +69,9 @@
                             if (value == null){
                                 value = "false";
                             }
+                            else {
+                                value = "true";
+                            }
                         }
                         diagrammOptions.setValue(parameter.getName(),value);
 
@@ -101,15 +105,15 @@
                             request
                                     .getRealPath("WEB-INF/config/templates/describe-ui-static.xsl"));
             request.setAttribute("staticui", staticUI);
-            request.setAttribute("furthertargets",
-                    (ad.getReachableStates() != null && !ad
-                            .getReachableStates().isEmpty()));
 
-            if (ad.getReachableStates() != null
-                && !ad.getReachableStates().isEmpty()) {
-            } else {
+            Map tmpOuts = ad.getOutputModes();
+            if (tmpOuts == null || tmpOuts.isEmpty()) {
+                request.setAttribute("furthertargets", true);
+            }
+            else {
                 request.setAttribute("diagramm", true);
             }
+
             return super.execute(mapping, form, request, response);
         } catch (Exception e) {
             log.error(e, e);

http://dive4elements.wald.intevation.org