title: How to disable the drop down function of combo box on certain conditions?
body: <p>I have a combo box in my application. I also have a variable  called "Status". I want the combo box to be enabled only when the value of the Status variable is 5 or 6. Otherwise, I should not be able to change the value in the combo box. It should have the previous value only..</p>
  
  <p>I had written a click event to disable the combo box. But even though the combo box is disabled, I get the drop down list of the combo box, and If I select some othe value in the drop down,it changes..Only after that it gets disabled..</p>
  
  <p>How to avoid this? I want the drop down function itself to be disabled. 
  This is the code I have written. Someone guide me.</p>
  
  <pre><code>&lt;mx:FormItem label="Review Status:" width="100%" horizontalAlign="right"&gt;
    &lt;mx:HBox&gt;
       &lt;mx:Label  width="30"/&gt;
          &lt;mx:ComboBox id="reviewStatus" dataProvider="{Status}" 
                       width="150" click="onStatusChange(event)"/&gt; 
    &lt;/mx:HBox&gt;
  </code></pre>
  
  <p> </p>
  
  <p>Action Script part:</p>
  
  <pre><code>private function onStatusChange(event:Event):void
  {
    var i:int;
    for(i=0;i&lt;defectDetails.length;i++)
    {
      var defStatusId:String=defectDetails.getItemAt(i).DefectStatusId;
      if(defStatusId=="5"){
                 reviewStatus.enabled=true;
      }  
      else  if(defStatusId=="6"){
                 reviewStatus.enabled=true;
      }
      else{
                 reviewStatus.enabled=false;
               //reviewStatus.selectedItem.label="Review";
               reviewStatus.toolTip="Status can be changed only if Defect Status is Verified or Deferred.";
  
                //Alert.show("Status can be changed only if defect status is verified or deferred");
      }
     }
    }
  </code></pre>
  
  <p>If I use Change event also, for the first time the value is changed. Only after that,the combo box is disabled. How to retain the same value and disable the combo box when the status is not 5 or 6?   </p>