1 Reply Latest reply on Apr 2, 2008 12:30 PM by Pete Muir

    Batch Insert

    Tomas Mika Newbie

      Hello,
      I have the model of master - detail - detailstate (each detail can have multiple states (by date))
      Customer asked me to implement the batch insert of the detail
      state, that he wants to have possibility to insert the state for all details of the given master.


      What I do is, that I prepare the new states in the seam component: (I use pageflows)


      @Name("batchStateInsert")
      @Scope(ScopeType.CONVERSATION)
      public class BatchStateInsertAction implements BatchStateInsert, Serializable
      {
      
      @Begin(join = true, pageflow = "batchStateInsertFlow")
      public String start()
          {
              newStates = new HashMap<Integer,ProductState>(companyHome
                      .getProducts().size());
      
              for (Product product : companyHome.getProducts())
              {
                  ProductState state = new ProductState();
                  state.setProduct(product);
      state.setShareValue(BigDecimal.ZERO);
      
                  newStates.put(product.getId(), state);
              }
              return CCConstants.OUTCOME_EDIT;
          }
      ...



      I am able to iterate the prpaired Map using c:forEach, read the prepaired values by


      <h:inputText value="#{batchStateInsert.newStates[product.id].shareValue}" />



      The problem is, that the value doesnt update, when sent back to the server.. does anyone know where is the problem?


      Or is there any common solution for this kind of issue?


      Thanks Tomas