1 Reply Latest reply on Nov 8, 2008 1:48 AM by deuce4

    Programatically select item in List ?

    deuce4
      I have an ArrayCollection which is displayed in a List. I am trying to see if there is a way to programatically select (highlight) the item in the list when a particular event is called elsewhere in the code.

      It seems like the SelectedIndex and SelectedItem properties read, but do not update the list visually.

      Or maybe I need to call an update method?
        • 1. Re: Programatically select item in List ?
          deuce4 Level 1
          oops. Apologies. It looks like
          <mx:List id="dbfList" width="200" height="300"
          dataProvider="{dbfArray}" labelField="Name"/>

          and in the Script:
          dbfList.selectedIndex=myIndexNum;

          does work, after all. Not sure why this didn't work initially for me, but now it is.

          Fantastic stuff, this Flex and Actionscript!