1 Reply Latest reply on May 10, 2006 1:11 PM by Jason Long

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

    Jason Long Master

      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.

       @DataModel(scope = ScopeType.PAGE)
       private List couplingMainList;
       private Map m;
       @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;
       public String receive()
       return "receiveCouplings";
       public void summary()
       couplingMainList = couplingDAO.getMainListFiltered(mainListCouplingFilter);
       public void total()
       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"
      <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?

        • 1. Re:   @DataModel(scope = ScopeType.PAGE) and @Factory proble
          Jason Long Master

          I solved the problem by using a get method on my bean instead of the factory to load the data table.

          I guess I am confused in the difference between


          and returning "couplingMainList" from a method.

           <redirect />

          Could someone please clarify?