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();
}
}
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);
}
}
}
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));
}
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();
}
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()));
}
Aggregations