7 Replies Latest reply on May 2, 2008 9:56 PM by infinity2heaven

    Values from UI not copied to SFSB with @in @Out

    infinity2heaven

      Usecase
      UI with a select box and a calendar date. Should invoke action and display results in a table based on the query selected by the user.


      I can get the basic flow working ies, a simple query to show all data in the table, however the form values are shown as null in the SFSB.


      facelet fragment


      <div id="fofSelection">
              <div id="commonField">FoF&#160; 
                  <h:selectOneMenu value="#{selectedFof}">    
                      <s:selectItems value="#{fofsQuery.resultList}" var="fof" label="#{fof.name}"
                          noSelectionLabel="Please select" />                 
                  </h:selectOneMenu> &#160;&#160;&#160; Time Period&#160;     
                  <rich:calendar id="date" datePattern="MMM/yyyy"
                        value="#{selectedTimePeriod}"/>                        
              </div>
      </div>



      SFSB




      @Stateful
      @Name(value="manageFund")
      @Scope(ScopeType.CONVERSATION)
      public class ManageFundAction implements ManageFund {
      
              @Logger
              private Log log;
               
              @In     
              private EntityManager entityManager;
              
              @In(required=false) @Out(required=false)
              private Date selectedTimePeriod;   
              
              @In(required=false) @Out(required=false)
          private Fof selectedFof;        
              
              @In(required=false) @Out(required=false)
          private FundPerformance fundPerf;        
                  
          @DataModel
          private List<FundPerformance> fundPerformances;
            
              
              /**
               * Retrieves Fund Performances for a selected time period and fof
               */
          public void retrieveFundPerformances() {
                fundPerformances = entityManager.createQuery("select fp from FundPerformance fp where fp.monthlyPerformance.fof.id =?1 and fp.timePeriod = ?2")            
            .setParameter(1,selectedFof)
            .setParameter(2,selectedTimePeriod)
            .getResultList();           
        }
                  
          @Remove
          @Destroy
          public void destroy() {}
             
      }




      I even changed the properties selectedFof and selectedTimePeriod from @In/@Out to simple setters/getters and accessed it directly using



      1. {manageFund.selectedFof}



      as given in the booking example, still it shows the values as null in the SFSB


      I've had a terrible time with Seam so far and I hope to get some help in the forums atleast.