3 Replies Latest reply on Jan 19, 2009 1:02 AM by

    Is it possible to make an item in combobox not be selectable ?

      Hi,
      In order to get a seperator in combobox , I am using follwing logic,
      <mx:Application xmlns:mx=" http://www.adobe.com/2006/mxml" layout="absolute">
      <mx:Script>
      <![CDATA[
      import mx.controls.Alert;
      [Bindable]
      public var arr:Array = [{label:"Test(1)"},{label:"Test(2)"},{label:"----------"},{label:"Test"},{label:"SimpleTe st"}]];

      public var str:String = "str";

      public function isItem(str:String):Boolean{
      if(str.match("--")){
      return false;
      }else
      return true;
      }


      ]]>
      </mx:Script>

      <mx:ComboBox width="250" dataProvider="{arr}" >
      <mx:itemRenderer>
      <mx:Component>

      <mx:Label text="{data.label}" color="#000000" selectable="{outerDocument.isItem(data.label)}" >

      </mx:Label>

      </mx:Component>
      </mx:itemRenderer>
      </mx:ComboBox>

      </mx:Application>

      But it is not working. Is there any solution for this.

      Also i would like to know whether my approach is right to get a separator between two groups of elements in combobox.

      Thank You...