diff --git a/navalplanner-webapp/src/main/java/org/navalplanner/web/common/ViewSwitcher.java b/navalplanner-webapp/src/main/java/org/navalplanner/web/common/ViewSwitcher.java index 251da726c..4da903978 100644 --- a/navalplanner-webapp/src/main/java/org/navalplanner/web/common/ViewSwitcher.java +++ b/navalplanner-webapp/src/main/java/org/navalplanner/web/common/ViewSwitcher.java @@ -25,6 +25,7 @@ import java.util.HashMap; import java.util.Map; import org.navalplanner.web.planner.allocation.AdvancedAllocationController; +import org.navalplanner.web.planner.allocation.AllocationResult; import org.navalplanner.web.resourceload.ResourceLoadController; import org.springframework.beans.factory.config.BeanDefinition; import org.springframework.context.annotation.Scope; @@ -52,18 +53,18 @@ public class ViewSwitcher implements Composer { isInPlanningOrder = true; } - public void goToAdvancedAllocation() { + public void goToAdvancedAllocation(AllocationResult allocationResult) { planningOrder = ComponentsReplacer.replaceAllChildren(parent, "advance_allocation.zul", - createArgsForAdvancedAllocation()); + createArgsForAdvancedAllocation(allocationResult)); isInPlanningOrder = false; } - private Map createArgsForAdvancedAllocation() { + private Map createArgsForAdvancedAllocation( + AllocationResult allocationResult) { Map result = new HashMap(); result.put("advancedAllocationController", - new AdvancedAllocationController( - ViewSwitcher.this)); + new AdvancedAllocationController(this, allocationResult)); return result; } 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 00103d1eb..ca064fd70 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 @@ -57,9 +57,12 @@ public class AdvancedAllocationController extends private Grid leftPane; private TimeTrackedTable table; private final ViewSwitcher switcher; + private final AllocationResult allocationResult; - public AdvancedAllocationController(ViewSwitcher switcher) { + public AdvancedAllocationController(ViewSwitcher switcher, + AllocationResult allocationResult) { this.switcher = switcher; + this.allocationResult = allocationResult; } @Override diff --git a/navalplanner-webapp/src/main/java/org/navalplanner/web/planner/allocation/ResourceAllocationController.java b/navalplanner-webapp/src/main/java/org/navalplanner/web/planner/allocation/ResourceAllocationController.java index 3b787d3a5..ca4ea2396 100644 --- a/navalplanner-webapp/src/main/java/org/navalplanner/web/planner/allocation/ResourceAllocationController.java +++ b/navalplanner-webapp/src/main/java/org/navalplanner/web/planner/allocation/ResourceAllocationController.java @@ -314,7 +314,7 @@ public class ResourceAllocationController extends GenericForwardComposer { public void advanceAllocation() { AllocationResult allocationResult = allocationsBeingEdited .doAllocation(); - switcher.goToAdvancedAllocation(); + switcher.goToAdvancedAllocation(allocationResult); window.setVisible(false); }