2 Replies Latest reply on Mar 15, 2012 8:33 AM by nt2005

    Submit form with many inputs

    nt2005

      Hello Community,

       

      How can I submit a form like:

       

      <h:form>

          <rich:comboBox defaultLabel="Enter some value">

              <f:selectItem itemValue="suggestion 1"/>

              ...

          </rich:comboBox>

          <h:inputText id="name" value="" />

          <h:inputText id="attribute1" value="" />

          <h:inputText id="attribute2" value="" />

          <h:inputText id="attributeN" value="" />

          <rich:pickList>

              <f:selectItem itemLabel="Option 1" itemValue="1"/>

              ...

          </rich:pickList>

      </h:form>

       

       

      The problem is: the number of inputs is not known so I cannot use a bean like: #{myBean.input1} #{myBean.input2}....

      The best would be to get a string of this submit like a get-submit:

      ?id=1391&name=notyou&pw=452

        • 1. Re: Submit form with many inputs
          david.salter

          Is there an upper limit to the number of inputs on your form?  If so, you could create them without rendering them and then make them visible when the previous is filled in?

           

          Alternatively, you could use the JSF api to dynamically create inputs within your bean class.

          1 of 1 people found this helpful
          • 2. Re: Submit form with many inputs
            nt2005

            Thank you for your advice.

             

            I now use jQuery to serialize the form and submit it to my bean and then analyse the string. Works good!

            1 of 1 people found this helpful