use of com.qcadoo.view.internal.components.tree.TreeComponentState in project qcadoo by qcadoo.
the class FormComponentState method copyEntityToFields.
private void copyEntityToFields(final Entity entity, final boolean requestUpdateState) {
for (Map.Entry<String, FieldComponentState> field : getFieldComponents().entrySet()) {
ErrorMessage message = entity.getError(field.getKey());
copyMessage(field.getValue(), message);
if (fieldIsGridCorrespondingLookup(field.getValue(), field.getKey(), entity)) {
continue;
}
if (fieldIsDetachedEntityTree(field.getValue(), field.getKey(), entity)) {
EntityTree tree = entity.getTreeField(field.getKey());
if (tree != null) {
((TreeComponentState) field.getValue()).setRootNode(tree.getRoot());
}
}
field.getValue().setFieldValue(convertFieldToString(entity.getField(field.getKey()), field.getKey()));
if (requestUpdateState) {
field.getValue().requestComponentUpdateState();
}
}
}
Aggregations