#55 Perfil de Personal Administrativo - Añadir Vacaciones del Empleado (Para seleccionar categoria requerir empleado)
This commit is contained in:
parent
2c30bed91f
commit
2582c5e903
@ -64,8 +64,14 @@ public class RequestRegisterView extends VerticalLayout {
|
|||||||
List<Employee> employees = employeeService.findAllEmployees();
|
List<Employee> employees = employeeService.findAllEmployees();
|
||||||
employeeComboBox.setItems(employees);
|
employeeComboBox.setItems(employees);
|
||||||
employeeComboBox.setItemLabelGenerator(emp -> emp.getFirstName() + " " + emp.getLastName());
|
employeeComboBox.setItemLabelGenerator(emp -> emp.getFirstName() + " " + emp.getLastName());
|
||||||
|
categoryComboBox.setEnabled(false);
|
||||||
categoryComboBox.setItems(TimeOffRequestType.values());
|
categoryComboBox.setItems(TimeOffRequestType.values());
|
||||||
categoryComboBox.addValueChangeListener(event -> updateAvailableDays(event.getValue()));
|
categoryComboBox.addValueChangeListener(event -> updateAvailableDays(event.getValue()));
|
||||||
|
employeeComboBox.addValueChangeListener(event -> {
|
||||||
|
if (event.getValue() != null) {
|
||||||
|
categoryComboBox.setEnabled(true);
|
||||||
|
}
|
||||||
|
});
|
||||||
startDatePicker.addValueChangeListener(event -> updateDatePickerMinValues());
|
startDatePicker.addValueChangeListener(event -> updateDatePickerMinValues());
|
||||||
endDatePicker.addValueChangeListener(event -> calculateDays());
|
endDatePicker.addValueChangeListener(event -> calculateDays());
|
||||||
availableDaysField.setReadOnly(true);
|
availableDaysField.setReadOnly(true);
|
||||||
|
Loading…
Reference in New Issue
Block a user