9 Replies Latest reply on Sep 2, 2010 5:36 PM by tony.herstell1

    Dynamic Form

      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!
        • 1. Re: Dynamic Form
          idyoshin

          why you can't add ajaxified form for entering 1 record per request, and dataTable to show the output ?


          regards,


          Ilya Dyoshin

          • 2. Re: Dynamic Form
            tony.herstell1

            SoftwareFactory (NZ) has used Seam to create dynamic fields to add to any form.


            Hard to explain as I am not author but can be one of


            Alpha, Numeric, Enum etc.


            Add to page template and they appear in the form and are mapped back to DB.


            PM if you want more info...


            This was always sort of missing from Seam.


            Glad our Software Manager has (is still completing final bits) found a way to do it.

            • 3. Re: Dynamic Form

              Hi Tony,


              I would be interesed in more info regarding the dynamic form code you mentioned. 


              Thanks,


              Aaron

              • 4. Re: Dynamic Form
                tony.herstell1

                Will get back to you.
                We are talking about putting it into a white paper.

                • 5. Re: Dynamic Form
                  tony.herstell1

                  Aaron,


                  Craig has gone one step further in that we have a blank page where you can add in lots of dynamic fields errr.. dynamically from the gui.


                  A white paper may be best once the final issues with Hibernate Mappings are sorted.


                  Will be in touch through this forum thread or privately following our discussions.

                  • 6. Re: Dynamic Form

                    A white paper may be best once the final issues with Hibernate Mappings are sorted.


                    Sounds great, can't wait to hear back from you guys.  The seam community is really impressive.  I'll keep an eye on this thread until i hear back from you.


                    Best,


                    Aaron

                    • 7. Re: Dynamic Form
                      tony.herstell1

                      Good to hear from you,


                      Craig has ok'd doing it, but also is critical path to get our first BIG software project out.


                      Will get done though as soon as reasonable.


                      Also, I still think it should be part of core Seam as people (Program Managers at Large Multi-Billion dollar companies) all say I wish we could have that kind of functionality in some projects I am running now ...


                      But that's up to the Seamsters.


                      Nice for Seam 3 perhaps.



                      • 8. Re: Dynamic Form
                        mdesignz

                        Just curious if there were any updates to this.

                        • 9. Re: Dynamic Form
                          tony.herstell1

                          I am really sorry but the developer is so flat out he can't get round to this task till at least January.


                          He has three fulltime projects at the moment :/


                          Hopefully will find(train) some more seam programmers and free up some time for him to be able to post this answer.
                          Who knows, RH may pay for him to attend a RH conference and present it formally ...