From 2582c5e903c946f7d9a88cc9ac159e1e4971757f Mon Sep 17 00:00:00 2001 From: ricardo051199 Date: Sun, 20 Oct 2024 15:16:34 -0400 Subject: [PATCH] =?UTF-8?q?#55=20Perfil=20de=20Personal=20Administrativo?= =?UTF-8?q?=20-=20A=C3=B1adir=20Vacaciones=20del=20Empleado=20(Para=20sele?= =?UTF-8?q?ccionar=20categoria=20requerir=20empleado)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/primefactorsolutions/views/RequestRegisterView.java | 6 ++++++ 1 file changed, 6 insertions(+) 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);