use of com.qcadoo.view.api.components.lookup.FilterValueHolder in project mes by qcadoo.
the class SizeGroupDetailsHooks method fillCriteriaModifiers.
public void fillCriteriaModifiers(final ViewDefinitionState view) {
FormComponent sizeGroupForm = (FormComponent) view.getComponentByReference(QcadooViewConstants.L_FORM);
LookupComponent sizeLookup = (LookupComponent) view.getComponentByReference("sizeLookup");
Long sizeGroupId = sizeGroupForm.getEntityId();
if (Objects.nonNull(sizeGroupId)) {
FilterValueHolder filter = sizeLookup.getFilterValue();
filter.put("sizeGroupId", sizeGroupId);
sizeLookup.setFilterValue(filter);
}
sizeLookup.requestComponentUpdateState();
}
use of com.qcadoo.view.api.components.lookup.FilterValueHolder in project mes by qcadoo.
the class DeliveredProductDetailsHooks method filterBy.
private void filterBy(final LookupComponent componentState, final String field, final Long id) {
FilterValueHolder filterValueHolder = componentState.getFilterValue();
filterValueHolder.put(field, id);
componentState.setEnabled(true);
componentState.setFilterValue(filterValueHolder);
componentState.requestComponentUpdateState();
}
use of com.qcadoo.view.api.components.lookup.FilterValueHolder in project mes by qcadoo.
the class OrderedProductDetailsHooks method fillCriteriaModifiers.
private void fillCriteriaModifiers(final ViewDefinitionState viewDefinitionState) {
LookupComponent product = (LookupComponent) viewDefinitionState.getComponentByReference("product");
LookupComponent qualityCard = (LookupComponent) viewDefinitionState.getComponentByReference("qualityCard");
if (product.getEntity() != null) {
FilterValueHolder filter = qualityCard.getFilterValue();
filter.put(QualityCardCriteriaModifiers.L_PRODUCT_ID, product.getEntity().getId());
qualityCard.setFilterValue(filter);
qualityCard.requestComponentUpdateState();
}
}
use of com.qcadoo.view.api.components.lookup.FilterValueHolder in project mes by qcadoo.
the class OrderedProductDetailsHooks method fillAdditionalCodesLookup.
private void fillAdditionalCodesLookup(final ViewDefinitionState view) {
LookupComponent additionalCodeLookup = (LookupComponent) view.getComponentByReference(OrderedProductFields.ADDITIONAL_CODE);
LookupComponent productLookup = (LookupComponent) view.getComponentByReference(OrderedProductFields.PRODUCT);
Entity product = productLookup.getEntity();
if (Objects.nonNull(product)) {
additionalCodeLookup.setEnabled(true);
FilterValueHolder filterValueHolder = additionalCodeLookup.getFilterValue();
filterValueHolder.put(AdditionalCodeFields.PRODUCT, product.getId());
additionalCodeLookup.setFilterValue(filterValueHolder);
} else {
additionalCodeLookup.setFieldValue(null);
additionalCodeLookup.setEnabled(false);
}
additionalCodeLookup.requestComponentUpdateState();
}
use of com.qcadoo.view.api.components.lookup.FilterValueHolder in project mes by qcadoo.
the class ChangeStorageLocationHelperHooks method onBeforeRender.
public void onBeforeRender(final ViewDefinitionState view) {
FormComponent form = (FormComponent) view.getComponentByReference(QcadooViewConstants.L_FORM);
Entity entity = form.getEntity();
Entity delivery = entity.getBelongsToField(DeliveredProductFields.DELIVERY);
Entity location = delivery.getBelongsToField(DeliveryFields.LOCATION);
if (location != null) {
LookupComponent storageLocationLookup = (LookupComponent) view.getComponentByReference("storageLocation");
FilterValueHolder filter = storageLocationLookup.getFilterValue();
filter.put("location", location.getId());
storageLocationLookup.setFilterValue(filter);
}
}
Aggregations