Does anybody know how to do this?  I would assume that it has
something to do with pushing an index on the selectedIndices property
but I have been unable to get it to work.  I am able to select a
single element by setting selectedIndex to a valid index though.  I do
also have multipleSelection="true" in my mxml.  Here is my function:

public function selectList(data:Object)
{
        var optionGroupList:mx.controls.List = mx.controls.List(optionGroup);
        var lastIndex:Number = optionGroupList.length;
        
        //Echo.debug("selectList called with data: " + data + " " +
contentProvider.length);
        for (var i:Number = 0; i < contentProvider.length; ++i)
        {
                //Echo.debug("selectList: " + contentProvider[i].data + " == " +
data);
                if (contentProvider[i].data == data.toString()) {
                        Echo.debug("selecting " + i);
                        if (optionGroupList.selectedIndices == undefined)
                                optionGroupList.selectedIndex = i;
                        else
                                optionGroupList.selectedIndices.push(i);
                        //optionGroupList.selectedIndices[lastIndex++] = i;
                        
//optionGroupList.selectedItems.push(contentProvider[i]);
                        //optionGroupList.selectedIndex = i;
                }
        }
        mx.controls.Alert.show("selected indices: " +
optionGroupList.selectedIndices.length);
        //optionGroupList.layoutChildren();
}






------------------------ Yahoo! Groups Sponsor --------------------~--> 
<font face=arial size=-1><a 
href="http://us.ard.yahoo.com/SIG=12h27drt5/M=362131.6882499.7825260.1510227/D=groups/S=1705007207:TM/Y=YAHOO/EXP=1124412781/A=2889191/R=0/SIG=10r90krvo/*http://www.thebeehive.org
">Get Bzzzy! (real tools to help you find a job) Welcome to the Sweet Life 
- brought to you by One Economy</a>.</font>
--------------------------------------------------------------------~-> 

--
Flexcoders Mailing List
FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/flexcoders/

<*> To unsubscribe from this group, send an email to:
    [EMAIL PROTECTED]

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/
 


Reply via email to