2 Replies Latest reply on Apr 27, 2012 6:10 AM by Arun Viiswanathan

    Problem with <Mx:List>

    Arun Viiswanathan

      Hi,

          I had an issue with list control in flex. I am trying to implement a list that list some names where user can select each name by clicking on the item. My issue is if the list having the same name then not able to select the items in the list.(Even roll over is not happening)

       

      Here is the code:

       

      ?xml version="1.0" encoding="utf-8"?>

      <s:Application xmlns:fx="http://ns.adobe.com/mxml/2009"

                                       xmlns:s="library://ns.adobe.com/flex/spark"

                                       xmlns:mx="library://ns.adobe.com/flex/mx" minWidth="955" minHeight="600">

                <fx:Declarations>

                          <!-- Place non-visual elements (e.g., services, value objects) here -->

                </fx:Declarations>

                <fx:Script>

                          <![CDATA[

                                    [Bindable]

                                    private var testArray:Array=new Array("s1","s1","s1");

                          ]]>

                </fx:Script>

                          <mx:List dataProvider="{testArray}">

                          </mx:List>

      </s:Application>

       

      If the list having the different entries then I can roll over each item and select the item wanted. But if the list having the same name then everything goes wrong.

      Is there anyway to solve this issue?Please help

        • 1. Re: Problem with <Mx:List>
          _spoboyle Level 4

          the s1 should be "s1"

           

          <?xml version="1.0" encoding="utf-8"?>
          <s:Application xmlns:fx="http://ns.adobe.com/mxml/2009"
                                           xmlns:s="library://ns.adobe.com/flex/spark"
                                           xmlns:mx="library://ns.adobe.com/flex/mx" minWidth="955" minHeight="600">
                    <fx:Declarations>
                              <!-- Place non-visual elements (e.g., services, value objects) here -->
                    </fx:Declarations>
                    <fx:Script>
                              <![CDATA[
                                        [Bindable]
                                        private var testArray:Array = [
                                                                                          {label:"s1"},
                                                                                          {label:"s1"},
                                                                                          {label:"s1"}
                                                                                  ];
                              ]]>
                    </fx:Script>
                              <mx:List dataProvider="{testArray}">
                              </mx:List>
          </s:Application>
          
          
          • 2. Re: Problem with <Mx:List>
            Arun Viiswanathan Level 1

            Thank you _spoboyle that works..