0 Replies Latest reply on May 19, 2008 5:38 PM by hornp

    Accessing the value of generated input fields

    hornp

      Hi you SEAMists out there,


      I have a little problem with a couple of generated forms:



       <h:dataTable value="#{productManager.getProducts()}" var="product">
           <h:column>
               <h:outputText value="#{product.getTitle()}" />
           </h:column>
      
           <h:column>
               <h:form>
                   <h:inputText value="#{productManager.quantity}" required="true"/>
                   <h:outputText value=" " />
                   <h:commandButton value="buy" action="#{productManager.buyProduct(product, productManager.quantity)}" />
               </h:form>
           </h:column>
       </h:dataTable>
      



      where in the productManager, I have a private field product with the corresponding getter and setter.


      When I click the Buy button, the actual quantity is submitted only for the last product -- which is not too surprising.


      Bu the question is: how is this one the right way?


      Best Regards, Peter