From 51405319abdcf89bba3d079004e0d2599c35b9e9 Mon Sep 17 00:00:00 2001 From: Manuel Rego Casasnovas Date: Mon, 16 Nov 2009 11:44:29 +0100 Subject: [PATCH] ItEr34S13CUAsignacionRecursosEspecificosAPlanificacionItEr33S15: Mark as selected the proper assignment function in the combo. --- .../allocation/AdvancedAllocationController.java | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/navalplanner-webapp/src/main/java/org/navalplanner/web/planner/allocation/AdvancedAllocationController.java b/navalplanner-webapp/src/main/java/org/navalplanner/web/planner/allocation/AdvancedAllocationController.java index 84e49b4f0..28da53a00 100644 --- a/navalplanner-webapp/src/main/java/org/navalplanner/web/planner/allocation/AdvancedAllocationController.java +++ b/navalplanner-webapp/src/main/java/org/navalplanner/web/planner/allocation/AdvancedAllocationController.java @@ -39,6 +39,7 @@ import org.apache.commons.lang.Validate; import org.joda.time.DateTime; import org.joda.time.LocalDate; import org.navalplanner.business.planner.entities.AggregateOfResourceAllocations; +import org.navalplanner.business.planner.entities.AssignmentFunction; import org.navalplanner.business.planner.entities.CalculatedValue; import org.navalplanner.business.planner.entities.GenericResourceAllocation; import org.navalplanner.business.planner.entities.ResourceAllocation; @@ -744,18 +745,29 @@ class Row { } private Combobox getAssignmentFunctionsCombo() { + AssignmentFunction assignmentFunction = getAllocation() + .getAssignmentFunction(); + Combobox combobox = new Combobox(); combobox.setId("assigment_functions_combo"); Comboitem comboitem = new Comboitem(_("None")); comboitem.setValue(null); combobox.appendChild(comboitem); - combobox.setSelectedItem(comboitem); + if (assignmentFunction == null) { + combobox.setSelectedItem(comboitem); + } comboitem = new Comboitem(_("Stretches")); comboitem.setValue(StretchesFunction.class); combobox.appendChild(comboitem); + if (assignmentFunction != null + && assignmentFunction.getClass() + .equals(StretchesFunction.class)) { + combobox.setSelectedItem(comboitem); + } + return combobox; }