Search in sources :

Example 86 with CheckBoxComponent

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

Example 87 with CheckBoxComponent

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

Example 88 with CheckBoxComponent

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

Example 89 with CheckBoxComponent

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

Example 90 with CheckBoxComponent

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