0 Replies Latest reply on Jan 4, 2011 7:18 AM by omid pourhadi

    Seaminidad

    omid pourhadi Apprentice

      Hi,
      i'm using Apache Trinidad and seam and i have a small problem


      problem : i have a tr:inputListOfValues after user selects a record from it, i set record
      to entity instance in the begginig of conversation when user submits form, seam creates new instance of previous entity  and attribute i set it before goes null


      MovieHomeBean.java



      public class MovieHomeBean extends EntityHome<Movie> {
      
      @Begin(join=true, flushMode=FlushModeType.MANUAL)
      public String setPerson(Person p){
               RequestContext.getCurrentInstance().returnFromDialog(p.getLastName(), null);
            getInstance().setDirectorId(p);
           return null;
          }
      
      }



      movie.xhtml




      <tr:inputListOfValues required="true" searchDesc="Pick a member"                action="dialog:memberSelector" columns="20">
      <tr:setActionListener to="#{pageFlowScope.memType}" from="T" />
      </tr:inputListOfValues>
      <h:commandButton 
      rendered="#{not movieHome.managed}" id="register"
      value=" register movie "
      action="#{movieHome.persist}">
      


      memberDialog.xhtml




      <h:dataTable value="#{personList}" var="_person">
      <tr:commandButton text=" select person " 
      action="#{movieHome.setPerson(_person)}">
      <tr:setActionListener to="#{movieHome.instance.directorId}" from="#{_person}" />
      </tr:commandButton>     
      </h:datable>