0 Replies Latest reply on Aug 30, 2006 8:50 AM by GeorgeWS

    combobox to function?

    GeorgeWS Level 1
      I have 2 scripts the first has a hard coded PDES5W, I want the second script (the one that fills the combobox) to effect the PDES5W so when I change the combo box the PDES5W becomes PNUM5W so I can filter on the product number instead of the description. can you show me how that would look?

      <mx:Script>
      <![CDATA[
      public function initApp():void
      {
      }

      public function processFilter(item:Object):Boolean
      {
      var result:Boolean=false;
      var pattern:RegExp= new RegExp("^"+txtFilter.text,"i");
      if (!item.PDES5W.length
      || item.PDES5W.match(pattern))
      result=true;

      return result;
      }
      ]]>
      </mx:Script>

      <mx:Script>
      <![CDATA[

      [Bindable]
      public var myfilter: Array = [ {label:"Product ID", data:PNUM5W},
      {label:"Description", data:PDES5W}, {label:"Size", data:SDIVDE}, {label:"Pack", data:ISCF3W} ];

      [Bindable]
      public var selectedItem:Object;
      ]]>
      </mx:Script>

      <mx:ComboBox id="columnfilter" dataProvider="{myfilter}" close="selectedItem=ComboBox(event.target).selectedItem"/>