ComboBox inside an ItemRenderer keeps going back to initial selectedIndex

Hi,
     Thanks for taking a minute to help me solve this problem. I have the following component, what I want to do, is to save the selectedIndex on the data.selectedIndice variable. I have no trouble with that. The variable saves the correct new selected Index number, but the problem is that, for instance, if the initial selectedIndex was 0, and the user selects the third item of the ComboBox, the ComboBox will go back to selecting the 0 index (the new one was 3) even though that the seleccion.selectedIndex shows that 3 is selected (that's why data.selectedIndice saves 3)
<mx:HorizontalList
        bottom="0"
        backgroundAlpha="0.0"
        id="catalogoOpciones"
        columnCount="3"
        height="80"
        hideEffect="{esconderse}"
        horizontalScrollPolicy="on"
        selectable="false"
        showEffect="{mostrarse}"
        width="100%">
        <mx:itemRenderer>
           <mx:Component>
               <mx:VBox  height="100%" verticalGap="0" horizontalAlign="center" creationComplete="init()">
                   <mx:Label id="titulo" text="{data.nombre}"  textAlign="center" styleName="nombreOpcionDetallePlato" />
                   <mx:ComboBox id="seleccion" dataProvider="{data.opciones}" labelField="label"                          labelFunction="funcionLabelComboBox"  styleName="comboOpcionDetallePlato" change="changeHandler(event)" />
                    <mx:Script>
                        <![CDATA[
                            import menucomponents.clases.OpcionesEvent;
                            import mx.events.ListEvent;
                            import mx.controls.Alert;                                                       
                            public function init():void {
                            public function changeHandler(event:ListEvent):void {        
                                   Alert.show(seleccion.selectedIndex.toString);               //this shows the correct new index selected                                                             data.selectedIndice = seleccion.selectedIndex;               //at the beginning data.selectedIndice was 0, and when I                                                                                                                          change the selectedIdex, data.selectedIndice saves  1                             }                                                                                             correct value, but the ComboBox shows on the screen that                                                                                                                          the selected item is the first one (index 0) and not the                                                                                                                          second one (index 1) AS IT'S SUPPOSED TO                           
                            public function funcionLabelComboBox(item:Object):String {
                                    return item.label + ", $" + item.precio;
                        ]]>
                    </mx:Script>
                </mx:VBox>               
            </mx:Component>
       </mx:itemRenderer>
    </mx:HorizontalList>
Thanks for the help
Sebastián Toro O

selectedIndice is public. What's funny is that if I don't use the selectedIndex="{data.selectedIndice}" and I comment the line:
data.selectedIndice = seleccion.selectedIndex
Then the CombBox works just fine. It doesn't go back to the initial selectedIndex. I´m going to solve this using Events and an external Array (Array.length = ComboBox.dataProvider.length) to save the selectedIndex, it's a very un-elegant solution but i think it's going to work. Also I might add, that if I send an Event and catch it outside the List, and try to modify the data.selectedIndice, from the particular ComboBox that I changed, the ComboBox still changes automatically it's selectedIndex.
Thanks for your help.
If some day you think how to solve this, I would really appreciate if you post it here.
Sebastián Toro O.

Similar Messages

Maybe you are looking for

  • Black screen (or screen refresh) during the process of start up. T400, Vista home basic.

    My 2 weeks old T400 Vista home basic can start up successfully. But every time when I start or restart it, during the start process, after inputting the password, there are 4 times of black screen (or screen refresh). Is it normal? Thanks. 

  • SQL PLUS and socks

    I've tried to start sqlplus on NT4 with socks5 because my database server is outside a firewall. The socks works fine on my machine (I can telnet the port 1521 of the db server, or do a tnsping), but sqlplus cannot contact the db. Can you help me ? T

  • Is it possible to sync a clip without using multicam ?

    Hi there, I have some video clips recorded on 2 videos, we just say Video A & B. On the timeline, I mostly used clips from Video A. But for one 10 sec duration I prefer clip from Video B. How to I sync this 10-sec clip form video B to video A without

  • Cisco WCS on 64 bit Windows Server 2003

    I have been running WCS 4.2.62.0 on Windows 2003 R2 64 bit for some time with no issues whatsoever. Today I attempted to upgrade to WCS 5.0.56.0 and the installation terminates stating that WCS is not supported on 64 bit. My question is why this is s

  • P67A-GD65 How to stop the motherboard from checking exteral drive when BIOS boot

    I got four 2TB hard drives as external drives but every time when I restart my computer it takes so long to get pass the beeping phase. (At least 1 min) I unplug all USB hard drives leaving only a USB mouse and keyboard and it boots in seconds. So I