title: How to hide a WebMarkUpContainer checking an AjaxCheckBox in Wicket
body: <p>OK basically I have a WebMarkUpContainer which contains a DateTextField component and I want to make it visible only when I check an AjaxCheckBox.</p>
  
  <p>In general my code is:</p>
  
  <pre><code>private static final class Results extends BootstrapForm&lt;ResultsModel&gt;
      {
  
   final AjaxCheckBox isExamsSuccess = new AjaxCheckBox("isExamsSuccess") {           
  
              private static final long serialVersionUID = 1L;
  
              @Override
              protected void onUpdate(AjaxRequestTarget target) {
                  updateModel();
                  toggleStep(target);                 
              }
          };          
  
          final WebMarkupContainer wmc = new WebMarkupContainer("wmc");
  
          final DateTextField startDate = new DateTextField("startDate",
                      new DateTextFieldConfig()
                         .autoClose(true).withFormat("dd/MM/yyyy")
                         .withLanguage("el").withEndDate(new DateTime()));
  
  
  public Results(String id, CompoundPropertyModel&lt;ResultsModel&gt; propertyModel)
          {
  
              super(id, propertyModel);           
              add(isExamsSuccess);
              wmc.add(startDate);
              add(wmc);
  
    protected void toggleStep(AjaxRequestTarget target) {
              if(isExamsSuccess.getModelObject() == true){
                  isExamsSuccess.setModelObject(true);
                  wmc.setVisible(true);
                  target.add(wmc);
              }                        
              else {               
                  wmc.setVisible(false);                
                  target.add(wmc);
              }            
          }
  }
  </code></pre>
  
  <p>I would really appreciate some help</p>