title: WICKET: Control visibility of components on change CheckBox
body: <p>I'm using wicket framework.<br/><br/>
  Does anybody know how to control visibility of components in the form by clicking on checkBox component, and how to get boolean value of checkbox state when submit the form(true or false, depending on checked or not).<br/>
  I wanna do something like this:</p>
  
  <pre><code>TextField nameField = new TextField("name");
  
  public StateDB() {
  final AjaxCheckBox searchByFio = new AjaxCheckBox("searchByFio", new PropertyModel(this, "checkBoxValue")) {
              @Override
              protected void onUpdate(AjaxRequestTarget target) {
                  nameField.setVisible(checkBoxValue);
                  target.add(nameField);
              }
          };
  
  Form form = new Form("form");
  
  nameField.setOutputMarkupPlaceholderTag ( true );
  form.add(nameField);
  add(form);
  }
  </code></pre>
  
  <p>But result is not what I've expected. It just changes the html element like this<br>
  From: <br></p>
  
  <pre><code>&lt;input type="text" wicket:id="lastName" id="lastName" required="" value="" name="lastName"&gt;
  </code></pre>
  
  <p><br>
  To:<br></p>
  
  <pre><code>&lt;input id="lastName" style="display:none"&gt;
  </code></pre>
  
  <p>and vice versa</p>