ItEr14S13RFComportamentoGraficoPlanificador: Avoiding invalidation produced automatically by zk in Vbox (take a look
at Box#insertBefore(newChild, refChild). Appearance messed up.
This commit is contained in:
parent
82e9a3602a
commit
91901dd017
2 changed files with 5 additions and 12 deletions
|
|
@ -7,7 +7,6 @@ import java.util.List;
|
|||
import org.apache.commons.logging.Log;
|
||||
import org.apache.commons.logging.LogFactory;
|
||||
import org.zkoss.ganttz.util.TaskBean;
|
||||
import org.zkoss.zk.ui.Component;
|
||||
import org.zkoss.zk.ui.HtmlMacroComponent;
|
||||
|
||||
public class ListDetails extends HtmlMacroComponent {
|
||||
|
|
@ -27,7 +26,7 @@ public class ListDetails extends HtmlMacroComponent {
|
|||
}
|
||||
|
||||
private List<TaskDetail> getTaskDetails() {
|
||||
List<Object> children = getInsertionPoint().getChildren();
|
||||
List<Object> children = getChildren();
|
||||
return Planner.findComponentsOfType(TaskDetail.class, children);
|
||||
}
|
||||
|
||||
|
|
@ -43,7 +42,7 @@ public class ListDetails extends HtmlMacroComponent {
|
|||
}
|
||||
|
||||
private void removeDetail(TaskDetail taskDetail) {
|
||||
getInsertionPoint().getChildren().remove(taskDetail);
|
||||
getChildren().remove(taskDetail);
|
||||
}
|
||||
|
||||
public void addTask() {
|
||||
|
|
@ -51,7 +50,6 @@ public class ListDetails extends HtmlMacroComponent {
|
|||
newTask.setName("Nova Tarefa");
|
||||
newTask.setBeginDate(new Date());
|
||||
newTask.setEndDate(threeMonthsLater(newTask.getBeginDate()));
|
||||
System.out.println(newTask.getEndDate());
|
||||
addTask(newTask);
|
||||
getPlanner().addTask(newTask);
|
||||
}
|
||||
|
|
@ -73,12 +71,8 @@ public class ListDetails extends HtmlMacroComponent {
|
|||
|
||||
private void addTask(TaskBean taskBean) {
|
||||
TaskDetail taskDetail = TaskDetail.create(taskBean);
|
||||
getInsertionPoint().appendChild(taskDetail);
|
||||
appendChild(taskDetail);
|
||||
taskDetail.afterCompose();
|
||||
}
|
||||
|
||||
private Component getInsertionPoint() {
|
||||
return getFellow("insertionPoint");
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,7 +1,6 @@
|
|||
<?taglib uri="http://www.zkoss.org/dsp/web/core" prefix="c"?>
|
||||
<zk>
|
||||
<vbox class="listdetails" id="insertionPoint">
|
||||
<button label="${c:l('listdetails.add_task')}"
|
||||
onClick="insertionPoint.getParent().addTask();" />
|
||||
</vbox>
|
||||
onClick="self.getParent().addTask();" />
|
||||
|
||||
</zk>
|
||||
Loading…
Add table
Reference in a new issue