title: Wicket AjaxButton and javascript condition
body: <p>I am new with Wicket framework, so I don't know if this is possible. I want that when I click on submit button of form (in Java it's AjaxButton) javascript confirmation dialog pops up, but when I click No, it always calls method onSubmit of this button.
  What am I doing wrong?</p>
  
  <p>Here my code:</p>
  
  <pre><code>AjaxButton submit;
  add(submit = new AjaxButton("ajaxSubmitProduct"){
      private static final long serialVersionUID = 1L;
  
      @Override
      protected void onComponentTag(ComponentTag tag)
      {
          super.onComponentTag(tag);
          tag.put("onclick", "return confirm('Yes or No?');");
      }
      @Override
      protected void onSubmit(AjaxRequestTarget target, Form&lt;?&gt; form) {
          target.add(form);
  
          Product p = (Product) form.getModelObject();
          DBBroker.save_product(p);
          success("You have sucessfully added a new product.");
      }
  
      @Override
      protected void onError(AjaxRequestTarget target, Form&lt;?&gt; form)
      {
          target.add(form);
      }
  
  });    
  </code></pre>