title: issue while loading values from one listbox to other in apache wicket
body: <p>I am trying to develop 2 <strong>listmultiplechoice</strong> boxes to load values from one list{source} to other list{destination} and using <strong>Ajaxbuttons</strong> to load the values to each other. I am able to see the values in java classes when I click ajax button but these values are not getting properly loaded into the target listmultiplechoice box on UI. I have posted my code below, pls. check and let me know what is the wrong here?</p>
  
  <pre><code>private AjaxButton add;
  private AjaxButton remove;
  private List selectedOriginals;
  private List selectedDestinations;
  private ListMultipleChoice originals;
  private ListMultipleChoice destinations;
  private List&lt;String&gt; currentDestinations = new ArrayList&lt;String&gt;();
  
  originals = new ListMultipleChoice("originals", new PropertyModel(this, "selectedOriginals"),APPLICATIONS);
  originals.setOutputMarkupId(true);
  add(originals);
  
  destinations = new ListMultipleChoice("destinations", new PropertyModel(this, "selectedDestinations"), new LoadableDetachableModel() 
  {
      @Override
      protected Object load() 
      {
          return currentDestinations;
      }
  });
  destinations.setOutputMarkupId(true);
  add(destinations);
  
  add = new AjaxButton("add")
  {
      @Override 
      protected void onError(AjaxRequestTarget target, Form form) 
      { 
          System.out.println("Some error in AJX submission....");
          target.addComponent(feedbackPanel); 
      } 
  
      @Override
      protected void onSubmit(AjaxRequestTarget target, Form form) 
      {
          update(target,selectedOriginals, originals, destinations);
      }
  };
  add.setOutputMarkupId(true);
  add(add);
  
  remove = new AjaxButton("remove") 
  {
      @Override 
      protected void onError(AjaxRequestTarget target, Form form) 
      { 
          System.out.println("Some error in AJX submission....**********************");
          target.addComponent(feedbackPanel); 
      }
  
      @Override
      protected void onSubmit(AjaxRequestTarget target, Form form) 
      {
          update(target, selectedDestinations, destinations, originals);
      }
  };
  remove.setOutputMarkupId(true);
  add(remove);
  </code></pre>
  
  <p><strong>update method ::</strong></p>
  
  <pre><code>private void update(AjaxRequestTarget target, List&lt;String&gt; selections, ListMultipleChoice from, ListMultipleChoice to) 
  {
      if(selections != null)
      {
          for (String destination : selections) 
          {
              List&lt;String&gt; choices = getChoices(from);
              if (!to.getChoices().contains(destination)) 
              {
                  to.getChoices().add(destination);
                  choices.remove(destination);
                  from.setChoices(choices);
              }
          }
  
          target.addComponent(to);
          target.addComponent(from);
      }
  }
  </code></pre>