1 Reply Latest reply on Sep 5, 2007 1:37 AM by vinothPrakasam

    Displaying multiple selectedItems from a List

    stoopkid Level 1
      Hey everyone, I'm a student application developer for Northern Illinois University. I've been using Flex for about 4months now, and I'm almost embarassed to ask this question -- but no one around me has the slightest idea.

      I have a list box which loads up the days of the week. When you select a day (from the list box), the day of the week displays in a Label. Now, the issue I'm having is that my List is enabled to allow multiple selections, but I can't get the label to hold the multiple selectedItems.

      I know that you can technically only 'select' one item at a time, but I was hoping someone knew how to display all the items in a list that were highlighted. Here is the shortened code.

      [Bindable]
      public var selectedItem:Object;

      //Days of the week List
      <mx:Model id="mydays">
      <days>
      <day label="Monday" data="Monday"/>
      <day label="Tuesday" data="Tuesday"/>
      <day label="Wednesday" data="Wednesday"/>
      <day label="Thursday" data="Thursday"/>
      <day label="Friday" data="Friday"/>
      <day label="Saturday" data="Saturday"/>
      <day label="Sunday" data="Sunday"/>
      </days>
      </mx:Model>

      //Holds the days of the week
      <mx:List height="229" borderColor="#97cbff" borderStyle="solid" width="131" top="186" allowMultipleSelection="true" x="412" dataProvider="{mydays.day}" id="days" change="this.selectedItem=List(event.target).selectedItem">

      //Label that display the days of the week selected
      <mx:Label x="265" y="228" text="Current Day: {selectedItem.label}" width="343" id="currentDay" height="75"/>