#55 Perfil de Personal Administrativo - Añadir Vacaciones del Empleado (Para seleccionar categoria requerir empleado)

This commit is contained in:
jesus.pelaez 2024-10-20 15:16:34 -04:00
parent 2c30bed91f
commit 2582c5e903

View File

@ -64,8 +64,14 @@ public class RequestRegisterView extends VerticalLayout {
List<Employee> 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);