I have a form which let to add a new user...
I want to redirect the user, automatically, to the "user list" page once he clicked on the add button (of course, the new user will be add to the database).
I managed to add the new user but not to redirect to the "user list" page !
this is the add button implementation :
Code: Select all
<p:commandButton value="Add" type="Submit" action="#{userController.newuser(user)}" update="posCenter"/>
Code: Select all
public String redirectUserList(){
return "list_user.xhtml";
}
public void newuser(User var){
getFacade().create(var);
System.out.println("Partie 100");
liste = new ListDataModel(getFacade().findAll());
redirectUserList();
}