use of com.qcadoo.view.api.components.lookup.FilterValueHolder in project mes by qcadoo.
the class MasterOrderProductAttrValueDetailsHooks method setFilters.
private void setFilters(ViewDefinitionState view) {
LookupComponent attributeLookup = (LookupComponent) view.getComponentByReference(MasterOrderProductAttrValueFields.ATTRIBUTE);
LookupComponent attributeValueLookup = (LookupComponent) view.getComponentByReference(MasterOrderProductAttrValueFields.ATTRIBUTE_VALUE);
FilterValueHolder attributeValueLookupFilters = attributeValueLookup.getFilterValue();
if (Objects.nonNull(attributeLookup.getEntity())) {
attributeValueLookupFilters.put(L_ATTRIBUTE_ID, attributeLookup.getEntity().getId());
} else if (attributeValueLookupFilters.has(L_ATTRIBUTE_ID)) {
attributeValueLookupFilters.remove(L_ATTRIBUTE_ID);
}
attributeValueLookup.setFilterValue(attributeValueLookupFilters);
}
use of com.qcadoo.view.api.components.lookup.FilterValueHolder in project mes by qcadoo.
the class OrderCriteriaModifier method putMasterOrderNumberFilter.
public void putMasterOrderNumberFilter(final LookupComponent lookupComponent, final String masterOrderNumber) {
FilterValueHolder valueHolder = lookupComponent.getFilterValue();
valueHolder.put(MASTER_ORDER_NUMBER_FILTER_VALUE, masterOrderNumber);
lookupComponent.setFilterValue(valueHolder);
}
use of com.qcadoo.view.api.components.lookup.FilterValueHolder in project mes by qcadoo.
the class OrderCriteriaModifier method clearMasterOrderNumberFilter.
public void clearMasterOrderNumberFilter(LookupComponent lookupComponent) {
FilterValueHolder valueHolder = lookupComponent.getFilterValue();
valueHolder.remove(MASTER_ORDER_NUMBER_FILTER_VALUE);
lookupComponent.setFilterValue(valueHolder);
}
use of com.qcadoo.view.api.components.lookup.FilterValueHolder in project mes by qcadoo.
the class SalesPlanUseOtherTechnologyHooks method onBeforeRender.
public void onBeforeRender(final ViewDefinitionState view) throws JSONException {
String oldTechnologyId = view.getJsonContext().get("window.mainTab.salesPlanProduct.gridLayout.oldTechnologyId").toString();
Entity technology = dataDefinitionService.get(TechnologiesConstants.PLUGIN_IDENTIFIER, TechnologiesConstants.MODEL_TECHNOLOGY).get(Long.parseLong(oldTechnologyId));
Entity product = technology.getBelongsToField(TechnologyFields.PRODUCT);
FieldComponent oldTechnologyField = (FieldComponent) view.getComponentByReference("oldTechnology");
oldTechnologyField.setFieldValue(technology.getStringField(TechnologyFields.NUMBER));
LookupComponent technologyLookup = (LookupComponent) view.getComponentByReference(SalesPlanProductFields.TECHNOLOGY);
FilterValueHolder technologyFilterValueHolder = technologyLookup.getFilterValue();
technologyFilterValueHolder.put(TechnologyCriteriaModifiersO.PRODUCT_PARAMETER, product.getId());
technologyLookup.setFilterValue(technologyFilterValueHolder);
technologyLookup.setRequired(true);
}
use of com.qcadoo.view.api.components.lookup.FilterValueHolder in project mes by qcadoo.
the class ResourceAttributeValueDetailsHooks method setFilters.
private void setFilters(ViewDefinitionState view) {
LookupComponent attributeLookup = (LookupComponent) view.getComponentByReference(ResourceAttributeValueFields.ATTRIBUTE);
LookupComponent attributeValueLookup = (LookupComponent) view.getComponentByReference(ResourceAttributeValueFields.ATTRIBUTE_VALUE);
FilterValueHolder attributeValueLookupFilters = attributeValueLookup.getFilterValue();
if (Objects.nonNull(attributeLookup.getEntity())) {
attributeValueLookupFilters.put(L_ATTRIBUTE_ID, attributeLookup.getEntity().getId());
} else if (attributeValueLookupFilters.has(L_ATTRIBUTE_ID)) {
attributeValueLookupFilters.remove(L_ATTRIBUTE_ID);
}
attributeValueLookup.setFilterValue(attributeValueLookupFilters);
}
Aggregations