title: Wicket dummy form field
body: <p>I try to make form for user to register using Wicket. I got user POJO and wicket form - this needs to have "repeat password" field which should be in no way connected to User object. But how can I do this? I </p>
  
  <pre><code>public class RegisterForm extends Form&lt;User&gt; {
  
  private static final long serialVersionUID = -9071906666130179515L;
  
  public RegisterForm(String id) {
      super(id, new CompoundPropertyModel&lt;User&gt;(new User()));
  
      PasswordTextField pass  = new PasswordTextField("password");
      pass.setType(String.class);
  
      PasswordTextField pass2 = new PasswordTextField("password2");
      pass2.setType(String.class);
      pass2.setDefaultModelObject("");
  
      add(new EqualPasswordInputValidator(pass, pass2));
  
      add(new TextField&lt;String&gt;("login")
                  .setType(String.class)
                  .setRequired(true)
                  .add(new PatternValidator("[a-z0-9]*")));
  
      add(new TextField&lt;String&gt;("email")
                   .setType(String.class)
                   .add(EmailAddressValidator.getInstance()));
  
      add(pass);
  
      add(pass2);
  }
  </code></pre>
  
  <p>But i get </p>
  
  <blockquote>
    <p>java.lang.IllegalStateException:
    Attempt to set model object on null
    model of component:</p>
  </blockquote>
  
  <p>or that User model has no password2 related methods. How to handle such a case?</p>