1 Reply Latest reply on Feb 2, 2008 12:43 AM by Tobias Bergström

    Combo boxes interfearing with each other

    Tobias Bergström
      SOLVED IT. /Tobias


      Hi,
      When I use two combo boxes with the adobe example code (from the Flex component explorer) they interfear with each other. When I make a choice in one box the choice I made in the other box disapears. How do I change the code to avoid that / or do I need to use a different setup with the code?

      Can someone please explain how to Attach Code correctly (Can't find any "Insert code button" or similar)

      Se my example:

      <?xml version="1.0" encoding="utf-8"?>
      <mx:Application xmlns:mx=" http://www.adobe.com/2006/mxml" layout="absolute">
      <mx:Script>
      <![CDATA[
      [Bindable]
      public var vinalternativ: Array = [ {label:"1 glas husets", wine:65}, {label:"2 glas husets", wine:130}, {label:"3 rätters dryckespaket", wine:230} ];

      [Bindable]
      public var sluttider: Array = [ {label:"24.00", data:0}, {label:"01.00", data:1500}, {label:"02.00", data:3000} ];

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

      <!-- first combo -->

      <mx:ComboBox id="combobox2" x="86" y="73" dataProvider="{sluttider}" close="selectedItem=ComboBox(event.target).selectedItem" width="106"/>
      <mx:TextArea id="lokalhyra" x="289" y="74" width="70" height="22" text="{selectedItem.data}"/>

      <!-- second combo -->

      <mx:ComboBox id="vinCombo" dataProvider="{vinalternativ}" close="selectedItem=ComboBox(event.target).selectedItem" x="86" y="139" width="106"/>
      <mx:TextArea id="vinval" x="289" y="140" width="70" height="22" text="{selectedItem.wine}"/>
      </mx:Application>