From 4e40c8e1237f6b92425756a27365cb57c8c99f19 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jacobo=20Aragunde=20P=C3=A9rez?= Date: Mon, 30 Jan 2012 12:32:57 +0100 Subject: [PATCH] Bug #1357: Check if the date is out of the visualization area, and in that case set a new date before updating the legend. FEA: ItEr76S04BugFixing --- .../web/planner/order/OrderPlanningModel.java | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/libreplan-webapp/src/main/java/org/libreplan/web/planner/order/OrderPlanningModel.java b/libreplan-webapp/src/main/java/org/libreplan/web/planner/order/OrderPlanningModel.java index 9fb397a5e..42d1fe578 100644 --- a/libreplan-webapp/src/main/java/org/libreplan/web/planner/order/OrderPlanningModel.java +++ b/libreplan-webapp/src/main/java/org/libreplan/web/planner/order/OrderPlanningModel.java @@ -817,6 +817,19 @@ public class OrderPlanningModel implements IOrderPlanningModel { } private void updateEarnedValueChartLegend() { + try { + //force the validation again (getValue alone doesn't work because + //the result of the validation is cached) + earnedValueChartLegendDatebox.setValue( + earnedValueChartLegendDatebox.getValue()); + } + catch (WrongValueException e) { + //the user moved the gantt and the legend became out of the + //visualization area, reset to a correct date + earnedValueChartLegendDatebox.setValue(earnedValueChartFiller. + initialDateForIndicatorValues().toDateTimeAtStartOfDay() + .toDate()); + } LocalDate date = new LocalDate(earnedValueChartLegendDatebox.getRawValue()); org.zkoss.zk.ui.Component child = earnedValueChartLegendContainer .getFellow("indicatorsTable");