From 59cb273452156b1be90b5516505208e2566ff32b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=93scar=20Gonz=C3=A1lez=20Fern=C3=A1ndez?= Date: Mon, 27 Apr 2009 21:27:34 +0200 Subject: [PATCH] ItEr05S03ArquitecturaClientesItEr04S03: Fixing bug: If the task is aligned with the previous one, moving it backwards doesn't update the position. The fix consists of forcing the smart update, so the position is updated even if the date is not changed. This way the new client position is discarded. --- .../src/main/java/org/zkoss/ganttz/Task.java | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/navalplanner-gantt-zk/src/main/java/org/zkoss/ganttz/Task.java b/navalplanner-gantt-zk/src/main/java/org/zkoss/ganttz/Task.java index 04643e73d..100c32844 100755 --- a/navalplanner-gantt-zk/src/main/java/org/zkoss/ganttz/Task.java +++ b/navalplanner-gantt-zk/src/main/java/org/zkoss/ganttz/Task.java @@ -284,11 +284,19 @@ public class Task extends Div { } private void updateProperties() { + /* + * It is set to another value, so the smart update is forced. If the new + * value is equal to the previous, the smart update wouldn't be sent and + * it would keep the same position in the client. This position could be + * the result of dragging the task, so it would seem that the dependency + * is not enforced. + */ + setLeft("0"); setLeft(getMapper().toPixels(this.taskBean.getBeginDate()) + "px"); + setWidth("0"); setWidth(getMapper().toPixels(this.taskBean.getLengthMilliseconds()) + "px"); smartUpdate("name", this.taskBean.getName()); - } public void remove() {