1 Reply Latest reply on May 10, 2006 1:11 PM by supernovasoftware.com

      @DataModel(scope = ScopeType.PAGE) and @Factory problem

      I have a DataModel and regular variable that are both Maps which I am populating as follows:

      Note there are 2 factory methods one to populate the DataModel and one for the total.

       @SuppressWarnings("unused")
       @DataModel(scope = ScopeType.PAGE)
       private List couplingMainList;
       @DataModelSelection
       private Map m;
      
       @SuppressWarnings("unused")
       @Out(scope = ScopeType.PAGE)
       private Map couplingMainListTotal;
      
      
       //This is for Excel style AutoFilter
       @In(required = false)
       @Out(scope = ScopeType.SESSION, required = false)
       private MainListCouplingFilter mainListCouplingFilter;
      
       @Begin
       public String receive()
       {
       setup();
       return "receiveCouplings";
       }
      
      
       @Factory("couplingMainList")
       public void summary()
       {
       System.out.println("@Factory(couplingMainList)");
       couplingMainList = couplingDAO.getMainListFiltered(mainListCouplingFilter);
       }
      
       @Factory("couplingMainListTotal")
       public void total()
       {
       System.out.println("@Factory(couplingMainListTotal)");
       couplingMainListTotal = couplingDAO.getMainListFilteredTotal(mainListCouplingFilter);
       }
      
      


      The receive method is called which starts a conversation and sent to a page for user input. After the proper data has been entered I end the Conversation and send the user back to the main page.

      The total factory is being called, but the one thta populates is not. Refreshing the page calls both and load the page properly.

      Both are called if just navigating to the page.

      This is how I am calling the factories in JSF.

       <t:dataTable id="data"
       rows="20"
       var="couplingSummary"
       value="#{couplingMainList}"
       rendered="true"
       styleClass="f_table"
       rowClasses="tr0,tr1"
      
      ...
      
      <h:outputText value="#{couplingMainListTotal['sumPieces']}">
      
      


      Is this a problem with the way I am using Seam?
      A conflict with the scope using <t:dataTable>?

      I figured since the scope of the DataModel was PAGE that is would be reloaded every time the page was requested like the total.

      Any help would be greatly appreciated?