use of com.qcadoo.view.api.components.CheckBoxComponent in project mes by qcadoo.
the class PositionAddMultiListeners method addPositions.
public void addPositions(final ViewDefinitionState view, final ComponentState state, final String[] args) {
GridComponent resourceGrid = (GridComponent) view.getComponentByReference(L_RESOURCE_GRID);
CheckBoxComponent generated = (CheckBoxComponent) view.getComponentByReference(L_GENERATED);
Set<Long> selectedEntities = resourceGrid.getSelectedEntitiesIds();
if (selectedEntities.isEmpty()) {
generated.setChecked(false);
view.addMessage("materialFlowResources.positionAddMulti.noSelectedResources", ComponentState.MessageType.INFO);
return;
}
tryCreatePositions(view, selectedEntities);
generated.setChecked(true);
}
use of com.qcadoo.view.api.components.CheckBoxComponent in project mes by qcadoo.
the class StorageLocationsDetailsHooks method onBeforeRender.
public void onBeforeRender(final ViewDefinitionState view) {
FieldComponent maximumNumber = (FieldComponent) view.getComponentByReference(StorageLocationFields.MAXIMUM_NUMBER_OF_PALLETS);
CheckBoxComponent isPlace = (CheckBoxComponent) view.getComponentByReference(StorageLocationFields.PLACE_STORAGE_LOCATION);
if (isPlace.isChecked()) {
maximumNumber.setEnabled(true);
} else {
maximumNumber.setEnabled(false);
maximumNumber.setFieldValue(null);
maximumNumber.requestComponentUpdateState();
}
}
use of com.qcadoo.view.api.components.CheckBoxComponent in project mes by qcadoo.
the class WarehouseStockListHooks method fillDefaultFilters.
public void fillDefaultFilters(final ViewDefinitionState view) {
CheckBoxComponent initialized = (CheckBoxComponent) view.getComponentByReference("initialized");
if (initialized.isChecked()) {
return;
}
initialized.setChecked(true);
GridComponent grid = (GridComponent) view.getComponentByReference(QcadooViewConstants.L_GRID);
Map<String, String> filters = Maps.newHashMap();
filters.put("quantity", ">0");
grid.setFilters(filters);
}
use of com.qcadoo.view.api.components.CheckBoxComponent in project mes by qcadoo.
the class TrackingOperationProductInComponentDetailsListeners method onWasteUsedChange.
public void onWasteUsedChange(final ViewDefinitionState view, final ComponentState wasteUsed, final String[] args) {
CheckBoxComponent wasteUsedOnly = (CheckBoxComponent) view.getComponentByReference(L_WASTE_USED_ONLY);
FieldComponent wasteUsedQuantity = (FieldComponent) view.getComponentByReference(L_WASTE_USED_QUANTITY);
FieldComponent wasteUnit = (FieldComponent) view.getComponentByReference(L_WASTE_UNIT);
if (((CheckBoxComponent) wasteUsed).isChecked()) {
String productUnit = getFormEntity(view).getBelongsToField(L_PRODUCT).getStringField(ProductFields.UNIT);
if (StringUtils.isEmpty((CharSequence) wasteUnit.getFieldValue())) {
wasteUnit.setFieldValue(productUnit);
}
} else {
wasteUsedOnly.setFieldValue(null);
wasteUsedQuantity.setFieldValue(null);
wasteUnit.setFieldValue(null);
}
}
use of com.qcadoo.view.api.components.CheckBoxComponent in project mes by qcadoo.
the class OrderTimePredictionHooks method onBeforeRender.
public void onBeforeRender(final ViewDefinitionState view) {
FormComponent form = (FormComponent) view.getComponentByReference(QcadooViewConstants.L_FORM);
if (form.getEntityId() == null && view.isViewAfterRedirect()) {
CheckBoxComponent includeTpzField = (CheckBoxComponent) view.getComponentByReference(OrderFieldsPS.INCLUDE_TPZ);
boolean checkIncludeTpzField = parameterService.getParameter().getBooleanField("includeTpzPS");
includeTpzField.setChecked(checkIncludeTpzField);
includeTpzField.requestComponentUpdateState();
CheckBoxComponent includeAdditionalTimeField = (CheckBoxComponent) view.getComponentByReference(OrderFieldsPS.INCLUDE_ADDITIONAL_TIME);
boolean checkIncludeAdditionalTimeField = parameterService.getParameter().getBooleanField("includeAdditionalTimePS");
includeAdditionalTimeField.setChecked(checkIncludeAdditionalTimeField);
includeAdditionalTimeField.requestComponentUpdateState();
}
setCriteriaModifierParameters(view);
}
Aggregations