4 Replies Latest reply on Jan 5, 2011 6:50 AM by Nicolas U.

    Simple @In and @Out

    Nicolas U. Newbie

      Hello all.

      I had a xhtml with a list of person and when i click on one person of the list i'm redirected to detail view for this person.
      Then I have 2 pages: personList.xhtml and personView.xhtml.
      Each page have a backingbean: personListBean.java and personViewBean.java

      My link redirection on personList.xhtml look like:

      <h:commandLink action="#{personneListBean.selectEntity(_personne)}">
           <h:outputText value="#{_personne.id}" />

      In my personneListBean I have:

      @Out(required = false)
      private Person selectedPerson;
      public void selectEntity(Person p) {
           System.out.println("p: " + p.getNom());
           selectedPerson = p;
           System.out.println("selectedPerson: " + selectedPerson.getNom());

      And when i click on a row i see in console:

      11:03:09,876 INFO  [STDOUT] p: Lefebvre
      11:03:09,876 INFO  [STDOUT] selectedPerson: Lefebvre

      Then i know my code is executed and selectedPersonne is not null.

      In personViewBean.java I have:

      private Person selectedPerson;
      + getter and setter

      But when i click on a row my personView.xhtml fall in error:

      Caused by: org.jboss.seam.RequiredException: @In attribute requires non-null value: personneViewBean.selectedPerson

      How can i make it's work?