Author: bleny Date: 2010-11-04 10:32:57 +0000 (Thu, 04 Nov 2010) New Revision: 736 Log: bugfix : using filters no longer change page in synthesis Modified: trunk/wao-ui/src/main/java/fr/ifremer/wao/ui/pages/Synthesis.java Modified: trunk/wao-ui/src/main/java/fr/ifremer/wao/ui/pages/Synthesis.java =================================================================== --- trunk/wao-ui/src/main/java/fr/ifremer/wao/ui/pages/Synthesis.java 2010-11-03 18:42:33 UTC (rev 735) +++ trunk/wao-ui/src/main/java/fr/ifremer/wao/ui/pages/Synthesis.java 2010-11-04 10:32:57 UTC (rev 736) @@ -47,6 +47,7 @@ import fr.ifremer.wao.ui.data.RequiresAuthentication; import fr.ifremer.wao.ui.services.WaoManager; import org.apache.commons.collections.CollectionUtils; +import org.apache.commons.lang.BooleanUtils; import org.apache.tapestry5.Block; import org.apache.tapestry5.ComponentResources; import org.apache.tapestry5.RenderSupport; @@ -176,11 +177,16 @@ } Block activeBlock; - if (showGlobalSynthesis) { + if (BooleanUtils.isTrue(showGlobalSynthesis)) { activeBlock = resources.getBlock("globalSynthesis"); } else { activeBlock = resources.getBlock("ind" + getActiveSynthesis().ordinal()); } + + if (log.isDebugEnabled()) { + log.debug("activeBlock = " + activeBlock); + } + return activeBlock; } @@ -192,11 +198,11 @@ return ChartType.class.getName(); } - private boolean showGlobalSynthesis; + @Persist + private Boolean showGlobalSynthesis; public String getActionShowGlobalSynthesis() { - showGlobalSynthesis = true; - return "globalSynthesis"; + return "showGlobalSynthesis"; } @@ -216,15 +222,23 @@ @Log Object onAction(String actionType, String actionValue) { + + showGlobalSynthesis = false; + + if (log.isDebugEnabled()) { + log.debug("actionType = " + actionType); + } + // Delegator action (menu) if (actionType.equals(SynthesisId.class.getName())) { activeSynthesis = SynthesisId.valueOf(actionValue); return delegator.getBody(); - // Change chart type for dataSampling + // Change chart type for dataSampling } else if (actionType.equals(ChartType.class.getName())) { - dataSamplingChartType = ChartType.valueOf(actionValue); - } else if (actionType.equals("ShowGlobalSynthesis")) { - return "globalSynthesis"; + dataSamplingChartType = ChartType.valueOf(actionValue); + } else if (actionType.equals("showGlobalSynthesis")) { + showGlobalSynthesis = true; + return delegator.getBody(); } return this; }