use of com.qcadoo.view.internal.components.select.SelectComponentState in project mes by qcadoo.
the class PlannedEventDetailsHooks method setUnit.
public void setUnit(final ViewDefinitionState view) {
SelectComponentState basedOnSelect = (SelectComponentState) view.getComponentByReference(PlannedEventFields.BASED_ON);
FieldComponent toleranceUnitField = (FieldComponent) view.getComponentByReference("toleranceUnit");
switch(PlannedEventBasedOn.parseString((String) basedOnSelect.getFieldValue())) {
case COUNTER:
toleranceUnitField.setFieldValue(translationService.translate("cmmsMachineParts.plannedEvent.toleranceUnit.mh", view.getLocale()));
break;
case DATE:
toleranceUnitField.setFieldValue(translationService.translate("cmmsMachineParts.plannedEvent.toleranceUnit.days", view.getLocale()));
break;
}
}
use of com.qcadoo.view.internal.components.select.SelectComponentState in project mes by qcadoo.
the class TimeUsageReportHooks method onBeforeRender.
public final void onBeforeRender(final ViewDefinitionState view) {
SelectComponentState workersSelection = (SelectComponentState) view.getComponentByReference("workersSelection");
GridComponent workersGrid = (GridComponent) view.getComponentByReference("workers");
String selected = (String) workersSelection.getFieldValue();
if ("01all".equals(selected)) {
workersGrid.setEntities(Collections.emptyList());
workersGrid.setEnabled(false);
} else {
workersGrid.setEnabled(true);
}
}
Aggregations