Search in sources :

Example 56 with FieldComponent

use of com.qcadoo.view.api.components.FieldComponent in project mes by qcadoo.

the class CostNormsForMaterialsInOrderDetailsHooksSN method disabledFieldAboutCostFromOffer.

public void disabledFieldAboutCostFromOffer(final ViewDefinitionState view) {
    for (String reference : Arrays.asList("lastOfferCost", "averageOfferCost")) {
        FieldComponent field = (FieldComponent) view.getComponentByReference(reference);
        field.setEnabled(false);
        field.requestComponentUpdateState();
    }
}
Also used : FieldComponent(com.qcadoo.view.api.components.FieldComponent)

Example 57 with FieldComponent

use of com.qcadoo.view.api.components.FieldComponent in project mes by qcadoo.

the class NegotiationDetailsHooks method changeFieldsEnabledDependOnState.

public void changeFieldsEnabledDependOnState(final ViewDefinitionState view) {
    FormComponent negotiationForm = (FormComponent) view.getComponentByReference(QcadooViewConstants.L_FORM);
    FieldComponent stateField = (FieldComponent) view.getComponentByReference(STATE);
    String state = stateField.getFieldValue().toString();
    if (negotiationForm.getEntityId() == null) {
        changeFieldsEnabled(view, true, false);
    } else {
        if (COMPLETED.equals(state) || DECLINED.equals(state) || GENERATED_REQUESTS.equals(state)) {
            changeFieldsEnabled(view, false, false);
        } else {
            changeFieldsEnabled(view, true, true);
        }
    }
}
Also used : FormComponent(com.qcadoo.view.api.components.FormComponent) FieldComponent(com.qcadoo.view.api.components.FieldComponent)

Example 58 with FieldComponent

use of com.qcadoo.view.api.components.FieldComponent in project mes by qcadoo.

the class TechSubcontractingService method inheritSubcontractingValue.

public void inheritSubcontractingValue(final ViewDefinitionState view, final ComponentState componentState, final String[] args) {
    ComponentState operationLookup = view.getComponentByReference(OPERATION_FIELD);
    if (operationLookup.getFieldValue() == null) {
        return;
    }
    Entity operation = dataDefinitionService.get(TechnologiesConstants.PLUGIN_IDENTIFIER, TechnologiesConstants.MODEL_OPERATION).get((Long) operationLookup.getFieldValue());
    checkArgument(operation != null, "source entity is null");
    FieldComponent isSucontractungComponent = (FieldComponent) view.getComponentByReference(IS_SUBCONTRACTING);
    isSucontractungComponent.setFieldValue(operation.getField(IS_SUBCONTRACTING));
}
Also used : Entity(com.qcadoo.model.api.Entity) FieldComponent(com.qcadoo.view.api.components.FieldComponent) ComponentState(com.qcadoo.view.api.ComponentState)

Example 59 with FieldComponent

use of com.qcadoo.view.api.components.FieldComponent in project mes by qcadoo.

the class MaterialRequirementDetailsHooksTS method setMrpAlgoritmValue.

public void setMrpAlgoritmValue(final ViewDefinitionState view) {
    FormComponent form = (FormComponent) view.getComponentByReference(QcadooViewConstants.L_FORM);
    if (form.getEntityId() != null) {
        return;
    }
    FieldComponent mrpAlgoritm = (FieldComponent) view.getComponentByReference("mrpAlgorithm");
    mrpAlgoritm.setFieldValue(COMPONENTS_AND_SUBCONTRACTORS_PRODUCTS.getStringValue());
    mrpAlgoritm.requestComponentUpdateState();
}
Also used : FormComponent(com.qcadoo.view.api.components.FormComponent) FieldComponent(com.qcadoo.view.api.components.FieldComponent)

Example 60 with FieldComponent

use of com.qcadoo.view.api.components.FieldComponent in project mes by qcadoo.

the class TechnologyService method setLookupDisableInTechnologyOperationComponent.

public void setLookupDisableInTechnologyOperationComponent(final ViewDefinitionState view) {
    FormComponent form = (FormComponent) view.getComponentByReference(QcadooViewConstants.L_FORM);
    FieldComponent operationLookup = (FieldComponent) view.getComponentByReference(L_OPERATION);
    operationLookup.setEnabled(Objects.isNull(form.getEntityId()));
}
Also used : FormComponent(com.qcadoo.view.api.components.FormComponent) FieldComponent(com.qcadoo.view.api.components.FieldComponent)

Aggregations

FieldComponent (com.qcadoo.view.api.components.FieldComponent)443 Entity (com.qcadoo.model.api.Entity)201 FormComponent (com.qcadoo.view.api.components.FormComponent)183 LookupComponent (com.qcadoo.view.api.components.LookupComponent)107 BigDecimal (java.math.BigDecimal)47 CheckBoxComponent (com.qcadoo.view.api.components.CheckBoxComponent)31 GridComponent (com.qcadoo.view.api.components.GridComponent)31 Date (java.util.Date)30 Optional (com.google.common.base.Optional)18 AwesomeDynamicListComponent (com.qcadoo.view.api.components.AwesomeDynamicListComponent)14 ComponentState (com.qcadoo.view.api.ComponentState)13 FilterValueHolder (com.qcadoo.view.api.components.lookup.FilterValueHolder)13 WindowComponent (com.qcadoo.view.api.components.WindowComponent)12 RibbonActionItem (com.qcadoo.view.api.ribbon.RibbonActionItem)11 RibbonGroup (com.qcadoo.view.api.ribbon.RibbonGroup)9 PossibleUnitConversions (com.qcadoo.model.api.units.PossibleUnitConversions)7 SimpleDateFormat (java.text.SimpleDateFormat)7 ViewDefinitionState (com.qcadoo.view.api.ViewDefinitionState)6 QcadooViewConstants (com.qcadoo.view.constants.QcadooViewConstants)6 Collectors (java.util.stream.Collectors)6