9 Replies Latest reply on Sep 2, 2010 5:36 PM by Tony Herstell

    Dynamic Form

    Aaron Kirley Newbie
      I have a situation where I am dynamically building a form and i am trying to figure out an elegant way to capture the request parameters when the form is posted to the backing bean.

      Code for my dynamically generated form where quoteManager.itemList pulls a list of avaialbe "items" from our database and _item.quanity is a transient field in the Item entity.

      + My Form:
      "
      <h:form>
      <h:dataTable value="#{quoteManager.itemList}" var="_item">
        <h:column>               
         <f:facet name="header">
          <h:outputText value="Item Name"/>
         </f:facet>
         <h:outputText value="#{_item.name}"/>
        </h:column>
      <h:dataTable value="#{itemList}" var="_item">
        <h:column>               
         <f:facet name="header">
          <h:outputText value="Item Quantity"/>
         </f:facet>
         <h:inputText value="#{_item.quantity}"/>
        </h:column>
      </h:dataTable>
      <div>
        <h:commandButton value="Get Items" action="quoteManager.getItems"/>
      </div>
      </h:form>
      "

      Other than manually looping through the request parameter map to look for quanities, is there a feasable way to submit and capture the form described above?

      Thanks!