I was able to recreate this issue in a very simple example included
below. If I select a row, delete it (which auto selects the next
row)...if I then Shift-click another row...the highlighted row is not
included in the selected group. Any future shift-clicks from this
point work as expected. has anyone encountered this? I included a
sample Flex 2 mxml app with steps. Thanks in advance for your help:

<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml";
layout="vertical">
<mx:Script>
<![CDATA[
import mx.collections.ArrayCollection;
                
[Bindable]
private var dataAll : ArrayCollection = new
ArrayCollection(["aa","bb","cc","dd","ee","ff","gg","hh","ii",]);
        
private function deleteRow() : void
{
        var selectedIndices : Array = dg.selectedIndices;
        var highestIndex : int = getEmailWithHighestIndex(selectedIndices);
        trace("highestIndex=" + highestIndex);
        trace("pre delete=" + selectedIndices);
        highestIndex++;
        dg.selectedIndex = highestIndex;
        trace("after set=" + dg.selectedIndex);
        for each(var k:int in selectedIndices)
        {
                dataAll.removeItemAt(k);
        }
        dg.selectedIndex = dg.selectedIndex;
        trace("post delete (indices)=" + dg.selectedIndices);
        trace("post delete (index)=" + dg.selectedIndex);
}
private function mouseDownHandler() : void
{
        trace('mouseDOWN (indices)=' + dg.selectedIndices);
        trace('mouseDOWN (index)=' + dg.selectedIndex);
        trace('----------');
}
private function getEmailWithHighestIndex(selectedIndices : Array) : int
{
        var highestEmailIndex : int = 0;
        for(var g:int=0 ; g < selectedIndices.length; g++)
        {
                var currEmailIndex : int = int(selectedIndices[g]);
                if(currEmailIndex > highestEmailIndex)
                {
                        highestEmailIndex = currEmailIndex;
                }               
        }
        return highestEmailIndex;
} 
]]>
</mx:Script>
<mx:HBox width="100%" height="75%">
        <mx:TextArea width="100%" height="100%" htmlText="1.) Select 'cc'
&lt;br&gt;2.) Hold down 'Shift' and select 'dd' (notice how both rows
are selected). 
                &lt;br&gt;3.) Select 'cc' so it is the only row that is 
selected is
'cc'.&lt;br&gt;4.)Click delete ('dd' is now selected)&lt;br&gt;5.) Now
Shift-click 'ee'. This should select both rows but it does not. Why??? "/>
        <mx:VBox width="100%">
                <mx:List id="dg" dataProvider="{dataAll}" width="200" 
height="179"
allowMultipleSelection="true" mouseDown="{mouseDownHandler()}"/>
                <mx:Button label="delete" click="{deleteRow()}"/>
        </mx:VBox>
</mx:HBox>
</mx:Application>


Reply via email to