tags:

views:

12

answers:

1

Hi I've got a list and the selectedIndex doesn't seem to have any effect. Is the alternatingItemColors causing a problem?

I've got a panel with this list and a few radio buttons. I've set the defaults on the radio buttons, but I'm having problems setting 2010 as the default selection in the list.

<mx:List  

    id="myList" 
        width="120" 
        height="80"
        alternatingItemColors="[0xFFFFFF, 0xEEEEEE]"
        selectedIndex="0">

     <mx:dataProvider>
            <mx:Object label="2010" data="myData1" />
            <mx:Object label="2009" data="myData2" />
            <mx:Object label="2008" data="myData3" />
     </mx:dataProvider>

  <mx:List> 

I also tried adding: creationComplete="myList.selectedIndex=0", but that didn't work, either.

Any suggestions? Thank you.

-Laxmidi

A: 

Okay, I fiured it out. I was setting the selectedIndex in the component correctly. But, I had another function acting on the instance, which was causing the problem.

Thank you

-Laxmidi

Laxmidi