Search in sources :

Example 11 with CheckBoxComponent

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();
}
Also used : CheckBoxComponent(com.qcadoo.view.api.components.CheckBoxComponent)

Example 12 with CheckBoxComponent

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);
    }
}
Also used : FormComponent(com.qcadoo.view.api.components.FormComponent) CheckBoxComponent(com.qcadoo.view.api.components.CheckBoxComponent)

Example 13 with CheckBoxComponent

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();
}
Also used : CheckBoxComponent(com.qcadoo.view.api.components.CheckBoxComponent)

Example 14 with CheckBoxComponent

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);
    }
}
Also used : FieldComponent(com.qcadoo.view.api.components.FieldComponent) CheckBoxComponent(com.qcadoo.view.api.components.CheckBoxComponent)

Example 15 with CheckBoxComponent

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);
    }
}
Also used : CheckBoxComponent(com.qcadoo.view.api.components.CheckBoxComponent)

Aggregations

CheckBoxComponent (com.qcadoo.view.api.components.CheckBoxComponent)100 FormComponent (com.qcadoo.view.api.components.FormComponent)38 Entity (com.qcadoo.model.api.Entity)33 FieldComponent (com.qcadoo.view.api.components.FieldComponent)30 GridComponent (com.qcadoo.view.api.components.GridComponent)19 LookupComponent (com.qcadoo.view.api.components.LookupComponent)11 Date (java.util.Date)7 JSONObject (org.json.JSONObject)7 BigDecimal (java.math.BigDecimal)6 ComponentState (com.qcadoo.view.api.ComponentState)4 WindowComponent (com.qcadoo.view.api.components.WindowComponent)4 RibbonActionItem (com.qcadoo.view.api.ribbon.RibbonActionItem)4 IOException (java.io.IOException)4 MaterialFlowResourcesConstants (com.qcadoo.mes.materialFlowResources.constants.MaterialFlowResourcesConstants)2 DataDefinition (com.qcadoo.model.api.DataDefinition)2 DataDefinitionService (com.qcadoo.model.api.DataDefinitionService)2 SearchRestrictions (com.qcadoo.model.api.search.SearchRestrictions)2 ViewDefinitionState (com.qcadoo.view.api.ViewDefinitionState)2 AwesomeDynamicListComponent (com.qcadoo.view.api.components.AwesomeDynamicListComponent)2 Ribbon (com.qcadoo.view.api.ribbon.Ribbon)2