title: Wicket AjaxLink in Modal Window doesn´t work
body: <p>I am trying to add an AjaxLink inside a <code>ModalWindow</code>. This AjaxLink is used to do some stuff like deleting something off the database and finally close the <code>ModalWindow</code>.</p>
  
  <p>I added the <code>ModalWindow</code> accordording to the Wicket examples: <a href="http://www.wicket-library.com/wicket-examples-6.0.x/ajax/wicket/bookmarkable/org.apache.wicket.examples.source.SourcesPage?1&amp;SourcesPage_class=org.apache.wicket.examples.ajax.builtin.modal.ModalWindowPage&amp;source=ModalContent1Page.java" rel="nofollow noreferrer">Link to examples</a>. But this doesn´t work.</p>
  
  <p>My MainPage:</p>
  
  <pre><code>    public class EventPanel extends Panel {
              // some stuff happens here, the constructor accepts the eventModel
              final ModalWindow modal;
              add(modal = new ModalWindow("modal"));
              modal.setCookieName("modal-1");
  
              modal.setPageCreator(new ModalWindow.PageCreator() {
                  public Page createPage() {
                      // Use this constructor to pass a reference of this page.
                      return new DeleteEventWindow(eventModel, modal);
                  }
              });
  
              modal.setCloseButtonCallback(new ModalWindow.CloseButtonCallback() {
                  public boolean onCloseButtonClicked(AjaxRequestTarget target) {
                      // Change the passValue variable when modal window is closed.
  
                      return true;
                  }
              });
  
              // Add the link that opens the modal window.
              add(new AjaxLink&lt;Void&gt;("showModalLink") {
                  @Override
                  public void onClick(AjaxRequestTarget target) {
                      modal.show(target);
                  }
              });
        }
  </code></pre>
  
  <p>Modal Window:</p>
  
  <pre><code>    public class DeleteEventWindow extends WebPage {
  
             public DeleteEventWindow(final IModel&lt;Event&gt; model,
                                      final ModalWindow window) {
  
                // some stuff happens
  
                // this link doesn´t work
                add(new AjaxLink&lt;Void&gt;("closeOK") {
                    @Override
                    public void onClick(AjaxRequestTarget target) {
                   // Just a print to console for debugging
                    System.out.println("nooo");
                    window.close(target);
                 }
          });
  
      }
    }
  </code></pre>
  
  <p>ModalWindow HTML</p>
  
  <pre><code>   &lt;html&gt;
            &lt;head&gt;
                &lt;title&gt;Modal Content Page&lt;/title&gt;
            &lt;/head&gt;
     &lt;body&gt;
      &lt;!-- some other fields output --!&gt;
      &lt;a wicket:id="closeOK"&gt;close&lt;/a&gt;&lt;br/&gt;
     &lt;/body&gt;
     &lt;/html&gt;
  </code></pre>
  
  <p>The <code>ModalWindow</code> itself works fine, also the link is rendered. But if I click onto it, the <code>onClick</code> function doesn´t seem to be triggered. I also tried a normal <code>Link</code>, this works fine..</p>
  
  <p>I also found this question : <a href="https://stackoverflow.com/questions/13157818/wicket-ajaxlink-onclick-not-responding">stackoverflow question</a>, but I am using JQuery 1.9.1..</p>