Communication between two beans managed

3 views
Skip to first unread message

nathieb

unread,
Jun 9, 2009, 8:46:58 AM6/9/09
to Java Web Application
Hello,

I'm trying to developp an application with JSF and facelets.
For one page, i have a table with the list of users ( name, email ..)
when the actor click on a t:commandLink, he can edit this user.

But I use two facelets file print.xhtml -> edit.xhtml
the first use UserController.java ( managed bean ) and the second page
EditionUtilisateurs.java

when he click on the command link the page edit.xhtml and EditionUser
dont't exist.

In UserController, there is

public void modifierUtilisateur(ActionEvent event){
//UIParameter component = (UIParameter) event.getComponent
().findComponent("userId");
FacesContext context = FacesContext.getCurrentInstance();
Map map = context.getExternalContext().getRequestParameterMap
();
String attribut = (String) map.get("userId");
System.out.println("Attribut : " + attribut);
this.affichParam();
//String attribut = component.getValue().toString();
this.setUserEdition(true);
//On doit récupérer l'instance sur l'utilisateur et mettre les
valeurs
EditionUtilisateurs user = (EditionUtilisateurs)
FacesContext.getCurrentInstance().getExternalContext()
.getSessionMap().get("EditionUtilisateurs");
_cptgeodeuser = geodeUser.getUserId(new Long(attribut));
user.setNouvelUtilisateur(_cptgeodeuser);

}

but user throws an nullPointeurException . I think that I can't get an
object EditionUtilisateurs.

What is the solution to have the other instance in the context .

olivier
Reply all
Reply to author
Forward
0 new messages