title: Java Wicket - Prevent Form From Creating New Tab When Exception Occurs
body: <p>I am creating reports using Jasper right now and almost everything goes well. We set it in a way that if the user will preview a report, the report(pdf) will be shown on a new Tab. The problem is if an error occurs, a new Tab would still be opened instead of just showing the Feedback Panel on the original page.</p>
  
  <p>How can the form be setup in such a way that the feedback panel will be shown on the original page instead of the newly opened Tab?</p>
  
  <pre><code>Form&lt;?&gt; form = new Form&lt;Void&gt;("form");
  form.add(new AttributeAppender("target", Model.of("_blank")));
  
  SubmitLink view= new SubmitLink("view") {
      @Override
      public void onSubmit() {
          //code inside a try-catch to generate the report using Jasper}
  };    
  
  CptiDownloadButton download = new CptiDownloadButton("download", new AbstractReadOnlyModel&lt;File&gt;(){
   //CptiDownloadButton extends SubmitLink button and is a modification of Mr Ivaynberg's DownloadLink
  };
  
  
  &lt;form wicket:id="form"&gt;
      &lt;a href="#" wicket:id="submit"&gt;&lt;input type="button" wicket:message="value:search"/&gt;&lt;/a&gt;
      &lt;a href="#" wicket:id="download"&gt;&lt;input type="button"  wicket:message="value:download"/&gt;&lt;/a&gt;
  &lt;/form&gt;
  </code></pre>
  
  <p>Thanks in advance to anyone who'll answer. ^^</p>