title: Apache Wicket: Attempted to set property value on a null object. Property expression: metaCarrier Value: SearchFormSelectOption [key=367, value=KPN]
body: <p>I am trying with following code. </p>
  
  <p>I am getting error<br>
   <strong><em>Attempted to set property value on a null object. Property expression: metaCarrier Value: SearchFormSelectOption [key=367, value=KPN]</em></strong></p>
  
  <p>on Ajax call</p>
  
  <p>any idea what might be wrong?,</p>
  
  <p>code is as follows</p>
  
  <pre><code>   final DropDownChoice&lt;SearchFormSelectOption&gt; metaCarrier = new DropDownChoice&lt;SearchFormSelectOption&gt;("metaCarrier", carrierChoices, new ChoiceRenderer&lt;SearchFormSelectOption&gt;("value")
          {
             @Override
             public Object getDisplayValue(SearchFormSelectOption option)
             {
                LOG.error("check display object ....." + option.getValue());
                return option.getValue();
             }
  
             @Override
             public String getIdValue(SearchFormSelectOption option, int index)
             {
                return option.getKey();
             }
  
          });
       metaCarrier.setNullValid(true);
       metaCarrier.setOutputMarkupId(true);
       ruleCreationListView.add(metaCarrier);  
       metaCarrier.add(new AjaxFormComponentUpdatingBehavior("onchange")
          {
             /**
              * 
              */
             private static final long serialVersionUID = 1L;
  
             @Override
             protected void onUpdate(AjaxRequestTarget target)
             { 
             LOG.info("Carrier===============" + (getModelObject()).getMetaComSelectCarrier());
       }});
  
  
  
  
  
   public class SearchFormSelectOption implements Serializable
   {
  
     /** The Constant serialVersionUID. */
     private static final long serialVersionUID = 1L;
  
      /** The key. */
     private String key;
  
      /** The value. */
      private String value;
     //getter and setters
  </code></pre>