title: Ajax not working in wicket for me
body: <p>I wanted to test some AJAX DropDown in wicket 6.5 (tried wicket 6.6 and had same problems).</p>
  
  <p>I created my wicket test project using quickstart wicket page - <a href="http://wicket.apache.org/start/quickstart.html" rel="nofollow">http://wicket.apache.org/start/quickstart.html</a></p>
  
  <blockquote>
    <p>mvn archetype:generate -DarchetypeGroupId=org.apache.wicket -DarchetypeArtifactId=wicket-archetype-quickstart -DarchetypeVersion=6.6.0 -DgroupId=net.betlista -DartifactId=tests.wicket-6.6 -DarchetypeRepository=<a href="https://repository.apache.org/" rel="nofollow">https://repository.apache.org/</a> -DinteractiveMode=false</p>
  </blockquote>
  
  <p>I changed <code>HomaPage</code> to my <code>LoadableDropDownTestPage</code> in <code>getHomePage()</code> of generated <code>WicketApplication</code> class.</p>
  
  <p>Java code for LoadableDropDownTestPage is:</p>
  
  <pre class="lang-java prettyprint-override"><code>package net.betlista;
  
  import java.io.Serializable;
  import java.util.Arrays;
  import java.util.LinkedList;
  import java.util.List;
  
  import org.apache.wicket.ajax.AjaxRequestTarget;
  import org.apache.wicket.ajax.IAjaxIndicatorAware;
  import org.apache.wicket.ajax.form.OnChangeAjaxBehavior;
  import org.apache.wicket.ajax.markup.html.form.AjaxButton;
  import org.apache.wicket.markup.html.WebPage;
  import org.apache.wicket.markup.html.form.DropDownChoice;
  import org.apache.wicket.markup.html.form.Form;
  import org.apache.wicket.markup.html.panel.FeedbackPanel;
  import org.apache.wicket.model.IModel;
  import org.apache.wicket.model.LoadableDetachableModel;
  import org.apache.wicket.model.Model;
  import org.apache.wicket.model.PropertyModel;
  
  public class LoadableDropDownTestPage extends WebPage implements IAjaxIndicatorAware {
  
      public LoadableDropDownTestPage() {
          addComponents();
      }
  
      private void addComponents() {
          add(new FeedbackPanel("feedback"));
  
          FormObject formObject = new FormObject();
          Form&lt;FormObject&gt; form = new Form&lt;FormObject&gt;("loadableDropDownTestForm", Model.of(formObject));
          form.setOutputMarkupId(true);
          form.setOutputMarkupPlaceholderTag(true);
  
          final DropDownChoice&lt;String&gt; countryDD = new LoadableDropDown("countryDD", new PropertyModel&lt;String&gt;(formObject, "country"));
          countryDD.setChoices(new CountryLoadableModel());
          countryDD.setOutputMarkupId(true);
          countryDD.setRequired(true);
          countryDD.setOutputMarkupPlaceholderTag(true);
  
          final DropDownChoice&lt;String&gt; cityDD = new LoadableDropDown("cityDD", new PropertyModel&lt;String&gt;(formObject, "city"));
          cityDD.setChoices(new CityLoadableModel());
          cityDD.setOutputMarkupId(true);
          cityDD.setRequired(true);
          cityDD.setOutputMarkupPlaceholderTag(true);
  
          countryDD.add(new OnChangeAjaxBehavior() {
              @Override
              protected void onUpdate(AjaxRequestTarget target) {
                  System.out.println("country DD changed");
                  target.add(cityDD);
              }
          });
  
          form.add(countryDD);
          form.add(cityDD);
  
          form.add(new AjaxButton("ab") {} );
  
          add(form);
      }
  
      static class LoadableDropDown extends DropDownChoice&lt;String&gt; {
  
          public LoadableDropDown(String id, IModel&lt;String&gt; model) {
              super(id);
              setModel(model);
          }
  
      }
  
      static class FormObject implements Serializable {
          String country;
          String city;
      }
  
      class CountryLoadableModel extends LoadableDetachableModel&lt;List&lt;String&gt;&gt; {
  
          @Override
          protected List&lt;String&gt; load() {
              System.out.println("loading CountryLoadableModel");
              List&lt;String&gt; result = Arrays.asList(new String[] { "CR", "SR" } );
              return result;
          }
  
      }
  
      class CityLoadableModel extends LoadableDetachableModel&lt;List&lt;String&gt;&gt; {
  
          List&lt;String&gt; choices = new LinkedList&lt;String&gt;();
  
          @Override
          protected List&lt;String&gt; load() {
              System.out.println("loading CityLoadableModel");
              if (choices.isEmpty()) {
                  choices.add("1");
              } else {
                  int size = choices.size();
                  choices.add(Integer.toString(size+1));
              }
  
              return choices;
          }
  
      }
  
      @Override
      public String getAjaxIndicatorMarkupId() {
          return "ajaxIndicator";
      }
  
  }
  </code></pre>
  
  <p>and HTML for page is:</p>
  
  <pre class="lang-xml prettyprint-override"><code>&lt;!DOCTYPE html&gt;
  &lt;html xmlns:wicket="http://wicket.apache.org"&gt;
  
      &lt;div wicket:id="feedback"&gt;&lt;/div&gt;
  
      &lt;form wicket:id="loadableDropDownTestForm"&gt;
          Countries: &lt;select wicket:id="countryDD"&gt;&lt;/select&gt;&lt;br&gt;
          Cities: &lt;select wicket:id="cityDD"&gt;&lt;/select&gt;&lt;br&gt;
          &lt;!-- input type="submit"--&gt;
          &lt;button wicket:id="ab"&gt;&lt;/button&gt;
      &lt;/form&gt;
  
  
  &lt;/html&gt;
  </code></pre>
  
  <p>My very first problem is, that I couldn't see AJAX debug link on my page. But I think that while there is <code>OnChangeAjaxBehavior</code> I should see it.</p>
  
  <p>Next problem is that when I change value in country DropDown nothing happens and I have no idea what am I doing wrong.</p>
  
  <p>In my code you can see, that I tried also with AjaxButton, but that didn't work too.</p>
  
  <p>edit:</p>
  
  <p>part of the log (it's running in DEV mode)</p>
  
  <pre><code>********************************************************************
  *** WARNING: Wicket is running in DEVELOPMENT mode.              ***
  ***                               ^^^^^^^^^^^                    ***
  *** Do NOT deploy to your live server(s) without changing this.  ***
  *** See Application#getConfigurationType() for more information. ***
  ********************************************************************
  </code></pre>