title: Wicket dynamically add components to form
body: <p>I'm having trouble adding components to a form dynamically. What I'm trying to do is:
  Give the user a drop-down list with items they can choose like name, age, ...</p>
  <p>When a user presses add: there comes a (label + inputbox) in 1 component which allows them to put in the value. You might think I could hide those components which aren't selected but the user is also able to add values to the drop-down list.</p>
  <p><strong>The problem I have is how to add and remove components (label+ inputbox) without having wicket:ids in the HTML?</strong></p>
  <p>This is what I'm trying to add:</p>
  <pre><code>&lt;wicket:panel&gt;
    &lt;div wicket:id=&quot;hldValue&quot;&gt;
      &lt;label wicket:id=&quot;lblValue&quot;&gt;&lt;/label&gt;
      &lt;input type=&quot;text&quot; wicket:id=&quot;value&quot;/&gt;
    &lt;/div&gt;
  &lt;/wicket:panel&gt;
  </code></pre>
  <p>The problem I have here is that the ID is always the value I want to name dynamically. Is using dynamic HTML to create this component a good idea? I'm overriding <code>getMarkupResourceStream</code> and <code>getCacheKey</code> to achieve this. Still I feel this is not the right way. Any other suggestions?</p>