diff --git a/src/main/java/com/primefactorsolutions/views/RequestRegisterView.java b/src/main/java/com/primefactorsolutions/views/RequestRegisterView.java index 1ff9172..ba57022 100644 --- a/src/main/java/com/primefactorsolutions/views/RequestRegisterView.java +++ b/src/main/java/com/primefactorsolutions/views/RequestRegisterView.java @@ -64,8 +64,14 @@ public class RequestRegisterView extends VerticalLayout { List employees = employeeService.findAllEmployees(); employeeComboBox.setItems(employees); employeeComboBox.setItemLabelGenerator(emp -> emp.getFirstName() + " " + emp.getLastName()); + categoryComboBox.setEnabled(false); categoryComboBox.setItems(TimeOffRequestType.values()); categoryComboBox.addValueChangeListener(event -> updateAvailableDays(event.getValue())); + employeeComboBox.addValueChangeListener(event -> { + if (event.getValue() != null) { + categoryComboBox.setEnabled(true); + } + }); startDatePicker.addValueChangeListener(event -> updateDatePickerMinValues()); endDatePicker.addValueChangeListener(event -> calculateDays()); availableDaysField.setReadOnly(true);