title: How to read listbox's PropertyModel state from onUpdate() event of AjaxCheckBox - Apache Wicket
body: <p>Problem: user made some selection in the multi-selection listbox, then pressed a checkbox, and selection got lost. I need the selection to be preserved.</p>
  
  <p>I have a report wizard which extends (wicket.extensions.wizard.Wizard)
  I have a step which extends WizardStep.WizardStep
  On this step I have a mutli-selection box which extends wicket.markup.html.form.ListMultipleChoice
  I add it as follows:</p>
  
  <pre><code>
  final ChooseListMultipleChoice allPlansChoiceField = new ChooseListMultipleChoice(PLANS_SELECT_ALL_PLANS_LIST, new PropertyModel(this, "selectedAllPlans"), allPlans);
  allPlansChoiceField.setOutputMarkupId(true);
  add(allPlansChoiceField);
  </code></pre>
  
  <p>and I also have AjaxCheckBox (wicket.ajax.markup.html.form.AjaxCheckBox)
  Used like this:</p>
  
  <pre><code>
    AjaxCheckBox displayArchived = new AjaxCheckBox(DISPLAY_ARCHIVED){
              protected void onUpdate(final AjaxRequestTarget target) {
                  allPlans.clear();
                  final boolean isDisplayArchived = rawReportFilterInput.isDisplayArchived();
                  List listAllPlan = projectFacade.listActiveAndClosingPlans(isSort, isDisplayArchived);
                  allPlans.addAll(listAllPlan);
                  target.addComponent(allPlansChoiceField);
              }
          };
          add(displayArchived);
  </code></pre>
  
  <p>inside the onUpdate method the model "selectedAllPlans" is not updated with current user selection. For instance, if I had just a simple ajax submit buttom, then it would have triggered the onSubmit event and all form data would have been passed and "selectedAllPlans" would be populated with user selection. 
  I need the exact same behaviour when user checks/unchecks the AjaxCheckBox. So far, I haven't been able to make it working, model is always size = 0.</p>
  
  <p>MarkUp:</p>
  
  <pre><code>&lt;div class="effortsReport" style="height: 220px;"&gt;
  &lt;table&gt;
      &lt;tr&gt;
          &lt;input type="checkbox" wicket:id="plansSelect.displayArchived"&gt;
          &lt;br&gt;&lt;div class="fixed_select"&gt;&lt;select wicket:id="allPlansList"/&gt;&lt;/div&gt;&lt;/td&gt;
      &lt;/tr&gt;
  &lt;/table&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>I would appreciate some advise, possible solutions.
  Best regards,
  Oleg</p>