ItEr44S10CUGravacionModelosUnidadesTraballoItEr43S12: Having to do a reload due to a zk bug.
This commit is contained in:
parent
9cc0e2c213
commit
2846af7044
2 changed files with 10 additions and 2 deletions
|
|
@ -233,7 +233,7 @@ public class LeftTasksTree extends HtmlMacroComponent {
|
|||
|
||||
/**
|
||||
* This class is a workaround for an issue with zk {@link Tree}. Once the
|
||||
* tree is created, a node with more children can't be added. Only the top
|
||||
* tree is created, adding a node with children is troublesome. Only the top
|
||||
* element is added to the tree, although the element has children. The Tree
|
||||
* discards the adding event for the children because the parent says it's
|
||||
* not loaded. This is the condition that is not satisfied:<br />
|
||||
|
|
|
|||
|
|
@ -119,8 +119,16 @@ public class OrderElementTreeController extends TreeController<OrderElement> {
|
|||
public void found(OrderElementTemplate template) {
|
||||
OrderLineGroup parent = (OrderLineGroup) getModel()
|
||||
.getRoot();
|
||||
orderModel.createFrom(parent, template);
|
||||
OrderElement created = orderModel.createFrom(parent,
|
||||
template);
|
||||
getModel().addNewlyAddedChildrenOf(parent);
|
||||
if (!created.getChildren().isEmpty()) {
|
||||
// due to a bug of zk Tree, the children of a newly
|
||||
// added element are not shown. Forcing reload.
|
||||
// See comments at
|
||||
// org.zkoss.ganttz.LeftTasksTree.DeferredFiller
|
||||
Util.reloadBindings(tree);
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue