use of com.qcadoo.view.api.components.CheckBoxComponent in project mes by qcadoo.
the class ParametersHooksPC method checkIfRegisterProductionTimeIsSet.
private void checkIfRegisterProductionTimeIsSet(final ViewDefinitionState viewDefinitionState) {
CheckBoxComponent registerProductionTime = (CheckBoxComponent) viewDefinitionState.getComponentByReference(ParameterFieldsPC.REGISTER_PRODUCTION_TIME);
CheckBoxComponent validateProductionRecordTimes = (CheckBoxComponent) viewDefinitionState.getComponentByReference(ParameterFieldsPC.VALIDATE_PRODUCTION_RECORD_TIMES);
if (registerProductionTime.isChecked()) {
validateProductionRecordTimes.setEnabled(true);
} else {
validateProductionRecordTimes.setEnabled(false);
validateProductionRecordTimes.setChecked(false);
}
validateProductionRecordTimes.requestComponentUpdateState();
}
use of com.qcadoo.view.api.components.CheckBoxComponent in project mes by qcadoo.
the class ProductionBalanceDetailsHooks method disableFieldsAndGridsWhenGenerated.
public void disableFieldsAndGridsWhenGenerated(final ViewDefinitionState view) {
CheckBoxComponent generatedCheckBox = (CheckBoxComponent) view.getComponentByReference(ProductionBalanceFields.GENERATED);
if (generatedCheckBox.isChecked()) {
productionCountingService.setComponentsState(view, L_FIELDS_AND_CHECKBOXES, false, true);
} else {
productionCountingService.setComponentsState(view, L_FIELDS, true, true);
}
if (generatedCheckBox.isChecked()) {
productionCountingService.setComponentsState(view, L_COST_FIELDS, false, true);
productionCountingService.setComponentsState(view, L_COST_GRIDS, false, false);
} else {
productionCountingService.setComponentsState(view, L_COST_FIELDS, true, true);
productionCountingService.setComponentsState(view, L_COST_GRIDS, true, false);
}
FormComponent form = (FormComponent) view.getComponentByReference(QcadooViewConstants.L_FORM);
if (form.getEntityId() == null) {
productionCountingService.setComponentsState(view, L_COST_GRIDS, false, false);
}
}
use of com.qcadoo.view.api.components.CheckBoxComponent in project mes by qcadoo.
the class ProductionPerShiftDetailsHooks method setupHasBeenCorrectedCheckbox.
void setupHasBeenCorrectedCheckbox(final ViewDefinitionState view) {
CheckBoxComponent hasBeenCorrectedCheckbox = (CheckBoxComponent) view.getComponentByReference(WAS_CORRECTED_CHECKBOX_REF);
hasBeenCorrectedCheckbox.setChecked(isCorrectedPlan(view));
hasBeenCorrectedCheckbox.requestComponentUpdateState();
}
use of com.qcadoo.view.api.components.CheckBoxComponent in project mes by qcadoo.
the class GenerateBalanceListeners method onFilterCheckboxChange.
public void onFilterCheckboxChange(final ViewDefinitionState view, final ComponentState component, final String[] args) {
CheckBoxComponent plannedRequiredCheckbox = (CheckBoxComponent) view.getComponentByReference("plannedQuantityRequired");
CheckBoxComponent deviationRequiredCheckbox = (CheckBoxComponent) view.getComponentByReference("deviationRequired");
FieldComponent deviationThreshold = (FieldComponent) view.getComponentByReference("deviationThreshold");
if (plannedRequiredCheckbox == null || deviationRequiredCheckbox == null) {
return;
}
deviationRequiredCheckbox.setEnabled(plannedRequiredCheckbox.isChecked());
if (!plannedRequiredCheckbox.isChecked()) {
deviationRequiredCheckbox.setChecked(false);
}
boolean thresholdEnabled = plannedRequiredCheckbox.isChecked() && deviationRequiredCheckbox.isChecked();
deviationThreshold.setEnabled(thresholdEnabled);
deviationThreshold.setRequired(thresholdEnabled);
if (!(plannedRequiredCheckbox.isChecked() && deviationRequiredCheckbox.isChecked())) {
deviationThreshold.setFieldValue(null);
}
}
use of com.qcadoo.view.api.components.CheckBoxComponent in project mes by qcadoo.
the class GenerateBalanceViewHooks method onBeforeRender.
public void onBeforeRender(final ViewDefinitionState viewState) {
toggleRibbonExportButtons(viewState);
CheckBoxComponent isInitializedCheckbox = (CheckBoxComponent) findComponent(viewState, "viewIsInitialized");
if (isInitializedCheckbox != null && !isInitializedCheckbox.isChecked()) {
fillDeviationThresholdUnit(viewState);
fillDateFieldsWithCurrentWorkWeekBounds(viewState);
isInitializedCheckbox.setChecked(true);
}
}
Aggregations