title: Wicket: Preventing form submission by a TextField within a Wizard step
body: <p>Question relates to Wicket 1.6</p>
  
  <p>I have a wizard step, <strong>which includes a Textfield component</strong>. When I press the Enter key, this is being handled by the default button of the Wizard bar ('Next'), and it advances to the next step in the Wizard. I don't want this to happen. When I hit Enter on the Textfield I just want the value to be updated, but remain on the same page.</p>
  
  <p>I tried overriding the <code>onBeforeRender()</code> method of my Wizard class, which as you can see sets the default button of the containing form to null. However this now results in the 'Prev' button being triggered when I hit Enter, so the wizard goes back to the previous step.</p>
  
  <pre><code>public class ConfigurationWizard extends Wizard {
  
     ....
  
     @Override
     protected void onBeforeRender()
      {
          super.onBeforeRender();
          Component buttonBar = getForm().get(BUTTONS_ID);
          if (buttonBar instanceof IDefaultButtonProvider)
          {
              getForm().setDefaultButton(null);
          }
      }
  }
  </code></pre>
  
  <p>So the basic question is, how do I disable the default button behaviour of the Wizard?</p>