1 Reply Latest reply on Oct 2, 2008 2:58 AM by nikos101

    I have a strange error when I close  a combobox:

    nikos101 Level 2
      I have a strange error when I close a combobox:

      <mx:ComboBox
      id="currencyComboBox"
      prompt="Select Currency" dropdownStyleName="dropdown"
      labelField="currencyName"

      >
      <mx:close>
      <![CDATA[
      selectedItem = ComboBox(event.target).selectedItem;
      calculateCustomerData();
      ]]>
      </mx:close>
      <mx:change>
      <![CDATA[
      selectedItem = ComboBox(event.target).selectedItem;
      calculateCustomerData();
      ]]>
      </mx:change>
      </mx:ComboBox>

      RangeError: Index '7' specified is out of bounds.
      at mx.collections::ListCollectionView/getItemAt()[E:\dev\3.0.x\frameworks\projects\framework \src\mx\collections\ListCollectionView.as:422]

      This only occurs when its dataprovider is from a result event rather than its dataprovider from a predifined arraycollection.

      private function handleGetBanks(event:ResultEvent):void{
      bankResult = new ArrayCollection((event.result as ArrayCollection).source);
      currencyComboBox.dataProvider = event.result as ArrayCollection;
      }

      rather than using the following as a dataprovider:

      <mx:ArrayCollection id="currencies">
      <mx:Object label="AED" />
      <mx:Object label="AUD" />
      <mx:Object label="CAD" />
      <mx:Object label="EUR" />
      <mx:Object label="NZD" />
      <mx:Object label="USD" />
      <mx:Object label="ZAR" />
      </mx:ArrayCollection>


      Can anyone see what the problem might be?