title: How to update a Panel when user selects a drop down choice in Wicket?
body: <p>I would like to know how to update a panel when we select a drop down chioce values, that is in onUpdate() method.</p>
  
  <p>My custom panel has AjaxFallbackDefaultDataTable.</p>
  
  <p>Below is Panel and drop down components code. When user selects date, I want to replace my entire Panel. Currently I have commened that target.addComponent code, but I want to have implementation here. Any suggestions?</p>
  
  <pre><code>List&lt;DealHistory&gt; dealHistoryList = ServicesCaller
              .getAllDealHistoryRecords();
      DealHistoryTablePanel dealHistoryTablePanel = new DealHistoryTablePanel(
              "deal_history_table_panel", dealHistoryList);
      dealHistoryTablePanel.setOutputMarkupId(true);
  
      add(dealHistoryTablePanel);
  
      IModel&lt;List&lt;? extends String&gt;&gt; dateChoices = new AbstractReadOnlyModel&lt;List&lt;? extends String&gt;&gt;() {
          @Override
          public List&lt;String&gt; getObject() {
              List&lt;String&gt; list = new ArrayList&lt;String&gt;();
              list.add("Last 3 months");
              list.add("Last 6 months");
              return list;
          }
      };
  
      final DropDownChoice&lt;String&gt; datesDropDown = new DropDownChoice&lt;String&gt;(
              "dates", new PropertyModel&lt;String&gt;(this, "selectedDate"),
              dateChoices);
      datesDropDown.add(new AjaxFormComponentUpdatingBehavior("onchange") {
          @Override
          protected void onUpdate(AjaxRequestTarget target) {
              //target.addComponent(dealHistoryTablePanel);
          }
      });
      add(datesDropDown);
  </code></pre>