0 Replies Latest reply on May 3, 2007 10:45 PM by AuroraCF

    Script to Filter for Multiple ComboBox

    AuroraCF
      Hello,

      I am trying to create two combo boxes, company and contact. When company selected only contacts for that company display in the contact combo box. I created the script below but it does not work. Please look at the script and tell me what if I miss out any thing?

      TIA,


      private function Jobs_CompanyIDLookup_result(event:ResultEvent):void
      {
      this.Jobs_CompanyID.dataProvider = event.result;
      var compID:Object = new Object();
      compID.CompanyName = "Select one";
      compID.CompanyID = 0;
      this.Jobs_CompanyID.dataProvider.addItemAt(compID, 0);
      if (this._key == null){
      Jobs_CompanyID.selectedIndex = 0;
      }else
      {
      this.Jobs_CompanyID.selectedItem = originalJobs_CompanyID;
      }
      }

      private function Jobs_ContactIDLookup_result(event:ResultEvent):void
      {
      this.Jobs_ContactID.dataProvider = event.result;
      var contID:Object = new Object();
      contID.FullName = "Select one";
      contID.ContactID = 0;
      this.Jobs_ContactID.dataProvider.addItemAt(contID, 0);
      if (this._key == null){
      Jobs_ContactID.selectedIndex = 0;
      }else
      {
      this.Jobs_ContactID.selectedItem = originalJobs_ContactID;
      Jobs_ContactID.selectedItem.CompanyID = Jobs_CompanyID.selectedItem.CompanyID;
      }
      }