title: Dynamic Form in GWT
body: <p>I'm building dynamic forms in GWT, but I'm not sure how to dynamically retrieve the values upon submission.</p>
  
  <p>I'm reading in question data from a DB and manually building elements that are added to a <code>FormPanel</code>:</p>
  
  <pre><code>    @UiField
      FormPanel formPanel;
  
      @Override
      protected void onLoad()
      {
         service.getFields(AysncCallbak&lt;Fields&gt; callback)
         {
             public void onSuccess(Fields result)
             {
                for(Object yo : fields.stuff())
                {
                    Element div = DOM.createDiv();
                    div.appendChild(DOM.createInputText());
                    formPanel.getElement().appendChild(div);
                }
             }
         }
      }
  </code></pre>
  
  <p>That's the gist in psuedocode, but I'm not sure how to retrieve the values after this point. </p>
  
  <p>I want to serialize the form (get the HTML) and parse it with DOM, but GWT produces invalid XHTML (the input tags are not terminated, causing parse failure).</p>
  
  <p>I could send the data to a Servlet, but there's a lot more stuff I need (other hidden input fields, etc.).</p>
  
  <p>Most GWT form examples are incredibly trivial, or have explicit fields declared. Should I look at a 3rd party library? How do I get the dynamic values?</p>