use of com.qcadoo.view.api.components.FieldComponent in project mes by qcadoo.
the class ProductionAnalysisParametersHooks method fillComponentWithPercent.
private void fillComponentWithPercent(String componentName, ViewDefinitionState viewDefinitionState) {
FieldComponent materialCostMarginProc = (FieldComponent) viewDefinitionState.getComponentByReference(componentName);
materialCostMarginProc.setFieldValue("%");
materialCostMarginProc.requestComponentUpdateState();
}
use of com.qcadoo.view.api.components.FieldComponent in project mes by qcadoo.
the class ProductionAnalysisParametersHooks method fillCurrencyAndUnitFields.
public void fillCurrencyAndUnitFields(final ViewDefinitionState viewDefinitionState) {
String currencyAlphabeticCode = currencyService.getCurrencyAlphabeticCode();
List<String> currencyFieldNames = Arrays.asList("averageMachineHourlyCostPBCurrency", "averageLaborHourlyCostPBCurrency", "additionalOverheadPBCurrency");
for (String currencyFieldName : currencyFieldNames) {
FieldComponent fieldComponent = (FieldComponent) viewDefinitionState.getComponentByReference(currencyFieldName);
fieldComponent.setFieldValue(currencyAlphabeticCode);
fieldComponent.requestComponentUpdateState();
}
fillComponentWithPercent("productionCostMarginPBProc", viewDefinitionState);
fillComponentWithPercent("materialCostMarginPBProc", viewDefinitionState);
fillComponentWithPercent("registrationPriceOverheadPBProc", viewDefinitionState);
fillComponentWithPercent("technicalProductionCostOverheadPBProc", viewDefinitionState);
fillComponentWithPercent("profitPBProc", viewDefinitionState);
}
use of com.qcadoo.view.api.components.FieldComponent in project mes by qcadoo.
the class ProductionBalanceDetailsHooks method fillCurrencyAndUnitFields.
public void fillCurrencyAndUnitFields(final ViewDefinitionState view) {
String currencyAlphabeticCode = currencyService.getCurrencyAlphabeticCode();
List<String> currencyFieldNames = Lists.newArrayList("additionalOverheadCurrency");
for (String currencyFieldName : currencyFieldNames) {
FieldComponent fieldComponent = (FieldComponent) view.getComponentByReference(currencyFieldName);
fieldComponent.setFieldValue(currencyAlphabeticCode);
fieldComponent.requestComponentUpdateState();
}
List<String> procFields = Lists.newArrayList("productionCostMarginProc", "materialCostMarginProc", "registrationPriceOverheadProc", "technicalProductionCostOverheadProc", "profitProc");
for (String field : procFields) {
FieldComponent materialCostMarginProc = (FieldComponent) view.getComponentByReference(field);
materialCostMarginProc.setFieldValue("%");
materialCostMarginProc.requestComponentUpdateState();
}
}
use of com.qcadoo.view.api.components.FieldComponent in project mes by qcadoo.
the class ProductionTrackingDetailsHooks method setStateFieldValueToDraft.
private void setStateFieldValueToDraft(final ViewDefinitionState view) {
FieldComponent stateField = (FieldComponent) view.getComponentByReference(L_STATE);
stateField.setFieldValue(ProductionTrackingState.DRAFT.getStringValue());
stateField.requestComponentUpdateState();
}
use of com.qcadoo.view.api.components.FieldComponent in project mes by qcadoo.
the class ProductionPerShiftDetailsHooks method fillProgressesUnitFields.
private void fillProgressesUnitFields(final AwesomeDynamicListComponent progressForDaysADL, final Optional<Entity> maybeMainOperationProduct) {
String unit = FluentOptional.wrap(maybeMainOperationProduct).flatMap(EntityUtils.<String>getSafeFieldExtractor(ProductFields.UNIT)).toOpt().orNull();
for (FormComponent progressForDayForm : progressForDaysADL.getFormComponents()) {
AwesomeDynamicListComponent dailyProgressADL = (AwesomeDynamicListComponent) progressForDayForm.findFieldComponentByName(DAILY_PROGRESS_ADL_REF);
for (FormComponent dailyProgressForm : dailyProgressADL.getFormComponents()) {
FieldComponent unitField = dailyProgressForm.findFieldComponentByName(UNIT_COMPONENT_NAME);
unitField.setFieldValue(unit);
unitField.requestComponentUpdateState();
}
dailyProgressADL.requestComponentUpdateState();
}
progressForDaysADL.requestComponentUpdateState();
}
Aggregations