#4-Registrar-empleado #15
@ -27,7 +27,7 @@ import java.util.UUID;
|
||||
@PermitAll
|
||||
@Scope("prototype")
|
||||
@PageTitle("Employee")
|
||||
@Route(value = "/employees/:action?/:employeeId?", layout = MainLayout.class)
|
||||
@Route(value = "/employees/:employeeId?/:action?", layout = MainLayout.class)
|
||||
public class EmployeeView extends BeanValidationForm<Employee> implements HasUrlParameter<String> {
|
||||
|
||||
private static final String SAVE_BUTTON_TEXT = "Save";
|
||||
@ -163,9 +163,9 @@ public class EmployeeView extends BeanValidationForm<Employee> implements HasUrl
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setParameter(final BeforeEvent beforeEvent, final String s) {
|
||||
public void setParameter(final BeforeEvent beforeEvent, final String action) {
|
||||
RouteParameters params = beforeEvent.getRouteParameters();
|
||||
String action = params.get("action").orElse("new");
|
||||
String s = params.get("employeeId").orElse(null);
|
||||
|
||||
if ("new".equals(action)) {
|
||||
setEntityWithEnabledSave(new Employee());
|
||||
|
@ -68,11 +68,11 @@ public class EmployeesListView extends Main {
|
||||
}
|
||||
|
||||
private void navigateToEditView(final Employee employee) {
|
||||
getUI().ifPresent(ui -> ui.navigate(EmployeeView.class, "edit/" + employee.getId().toString()));
|
||||
getUI().ifPresent(ui -> ui.navigate(EmployeeView.class, employee.getId().toString() + "/edit"));
|
||||
}
|
||||
|
||||
private void navigateToEmployeeView(final Employee employee) {
|
||||
getUI().ifPresent(ui -> ui.navigate(EmployeeView.class, "view/" + employee.getId().toString()));
|
||||
getUI().ifPresent(ui -> ui.navigate(EmployeeView.class, employee.getId().toString() + "/view"));
|
||||
}
|
||||
|
||||
private void navigateToAddEmployeeView() {
|
||||
|
Loading…
Reference in New Issue
Block a user