2 Replies Latest reply on Aug 16, 2011 2:24 PM by ChristophFlex

    Selecting mulitple items in a List programmaticly


      Hi everyone,


      my list doesn't shows my updates if i select a item programmaticly.



      this is an easy example showing my problem:



                  import mx.collections.ArrayList;
                  import mx.events.FlexEvent;

                  public var array:ArrayList=new ArrayList();
                  protected function view1_initializeHandler(event:FlexEvent):void
                      array.addItem("item 1");
                      array.addItem("item 2");
                      array.addItem("item 3");
                      array.addItem("item 4");
                      array.addItem("item 5");
                  protected function view1_creationCompleteHandler(event:FlexEvent):void
          <s:List width="100%" height="100%" dataProvider="{array}" allowMultipleSelection="true" id="list">


      The list doesn't show any selected items on prgramm start, but if i click for example item 3 or 5 which isnt in the selectedIndices array yet, item 1,2 and 4 becomes visual selected too. Seems like i have too tell the list somehow that it should check its selectedIndices vector if i select an item programmaticly.