title: How to enable/disable textfield on checkbox value change in apache wicket?
body: <p>I have an html form containing a check box &amp; a ListView containing some text fields. On checking the checkbox i want the textfields to be disabled &amp; vice versa.</p>
  
  <p>I am using checkbox with AjaxFormComponentUpdatingBehavior. But its not setting the textfields as enabled/disabled. Below is the code snippet -</p>
  
  <pre><code>Checkbox.add(new AjaxFormComponentUpdatingBehavior("onchange") {
          private static final long serialVersionUID = 1L;
  
          @Override
          protected void onUpdate(AjaxRequestTarget target) {
              listView.setEnabled(!Checkbox.getModelObject());
              listViewContainer.addOrReplace(listView);
              listViewContainer.setOutputMarkupId(true);
              target.addComponent(listViewContainer);
          }
      });
  </code></pre>
  
  <p>HTML is -</p>
  
  <pre><code>&lt;form wicket:id="geoForm"&gt;
        Checkbox: &lt;input type="checkbox" wicket:id="unmanagedChk" /&gt;
          &lt;div id="listViewContainer" wicket:id="listViewContainerId"&gt;
              &lt;div wicket:id="customGeoForChannel"&gt;         
                  &lt;div&gt;
                      Latitude(decimal):
                      &lt;input type="text" wicket:id="lat" maxlength="18" /&gt;
                  &lt;/div&gt;
                  &lt;div&gt;
                      Longitude(decimal):
                      &lt;input type="text" wicket:id="lon" maxlength="19" /&gt;
                  &lt;/div&gt;
                  &lt;div&gt;
                      Radius(miles):
                      &lt;input type="text" wicket:id="radius" maxlength="3" /&gt;
                  &lt;/div&gt;
              &lt;/div&gt;
          &lt;/div&gt;
   &lt;/form&gt;
  </code></pre>
  
  <p>geoForm --- Form</p>
  
  <p>customGeoForChannel --- ListView</p>
  
  <p>lat, lon, radius --- textfields</p>
  
  <p>unmanagedChk --- checkbox</p>