title: Processing a ListView inside a form
body: <p>Please consider the following signup:</p>
  
  <pre><code>&lt;form wicket:id="form"&gt;
    &lt;div wicket:id="fooList"&gt;                                        
      &lt;input wicket:id="fooList.quxField" type="text" size="10"/&gt;
    &lt;/div&gt;                
    &lt;button wicket:id="submit"&gt;&lt;wicket:message key="submitText"/&gt;&lt;/button&gt;    
  &lt;/form&gt;
  </code></pre>
  
  <p>And these two classes (I am assuming setters, getters etc.)</p>
  
  <pre><code>class FooClazz {        
      String quxField;
  }
  
  class BarClazz {
      List&lt;FooClazz&gt; fooList;
  }
  </code></pre>
  
  <p>And this form (models are wrapped in CompoundPropertyModel):</p>
  
  <pre><code>class BarForm extends Form&lt;BarClazz&gt; {
    public BarForm(String id,final IModel&lt;BarClazz&gt; model){
      super(id,model);
      add(new ListView&lt;FooClazz&gt;("fooList"){
        @Override
        protected void populateItem(final ListItem&lt;FooClazz&gt; item){
          item.add(new TextField&lt;String&gt;("fooList.quxField"));
        }                   
      }
    }
  }
  </code></pre>
  
  <p>Now the above code is generating a runtime exception for me:</p>
  
  <pre><code>2011-12-11 16:33:46 ERROR [org.apache.wicket.DefaultExceptionMapper] Unexpected error occurred org.apache.wicket.WicketRuntimeException: The expression 'quxField' is neither an index nor is it a method or field for the list class java.util.ArrayList
  </code></pre>
  
  <p>I can change the TextField to include a Model like this: </p>
  
  <pre><code>item.add(new TextField&lt;String&gt;("fooList.quxField", new Model&lt;String&gt;(model.getObject().getFooList().getQuxField())));
  </code></pre>
  
  <p>This resolves the error, but when I submit the form (with an Ajaxbutton) I never get to see the values entered into the form fields. </p>
  
  <p>So how can I keep the TextField models connected to my form model? Am I overlooking the obvious?
  (This is of course just a very shortened version of my original code ...)</p>
  
  <p>Need to add: all my models are wrapped in CompoundPropertyModels. </p>
  
  <p>Thanks in advance for any tips how to fix this.</p>