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

    Accessing the value of generated input fields

    Peter Horn Newbie

      Hi you SEAMists out there,

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

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

      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