Uploaded image for project: 'Apache Flex'
  1. Apache Flex
  2. FLEX-26894

Selection is incorrect on a List

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Minor
    • Resolution: Later
    • Adobe Flex SDK 4.1 (Release)
    • None
    • Spark: List
    • None
    • Affected OS(s): All OS Platforms
      Affected OS(s): All OS Platforms
      Browser: Firefox 3.x
      Language Found: English

    Description

      Steps to reproduce:

      Run the following code and you'll see that the index/indices returned are incorrect and often don't even match the view.

      <?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">

      <fx:Script>
      <![CDATA[
      protected function button1_clickHandler(event:MouseEvent):void

      { list.selectedIndices = Vector.<int>( [ 3, 4 ] ); trace( "list.selectedIndices:", list.selectedIndices, "list.selectedIndex:", list.selectedIndex ); }

      protected function button2_clickHandler(event:MouseEvent):void

      { list.selectedIndices = Vector.<int>( [ 5, 1 ] ); list.selectedIndices = Vector.<int>( [ 0, 2 ] ); trace( "list.selectedIndices:", list.selectedIndices, "list.selectedIndex:", list.selectedIndex ); }

      protected function button3_clickHandler(event:MouseEvent):void

      { list.selectedIndices = Vector.<int>( [ 4, 5 ] ); list.selectedIndex = 1; trace( "list.selectedIndices:", list.selectedIndices, "list.selectedIndex:", list.selectedIndex ); }

      ]]
      >
      </fx:Script>

      <s:layout>
      <s:VerticalLayout/>
      </s:layout>

      <s:List id="list" allowMultipleSelection="true">
      <s:ArrayList>
      <fx:Object label="1"/>
      <fx:Object label="2"/>
      <fx:Object label="3"/>
      <fx:Object label="4"/>
      <fx:Object label="5"/>
      <fx:Object label="6"/>
      <fx:Object label="7"/>
      </s:ArrayList>
      </s:List>

      <s:Button label="selectedIndices 3,4" click="button1_clickHandler(event)"/>

      <s:Button label="selectedIndices 5,1 then 0,2" click="button2_clickHandler(event)"/>

      <s:Button label="selectedIndices 4,5 then selectedIndex 1" click="button3_clickHandler(event)"/>

      </s:Application>

      This is due to the fact the selectedIndices doesn't return any proposed indices whilst waiting for validation to take place.

      This is also due to the fact that selectedIndices and selectedIndex do not cancel each other out. If i set a selectedIndex, it should cancel out any previously set selectedIndices and vice versa.

      It should not ever, ever be possible to get a result like the following.

      list.selectedIndices: 0,2 list.selectedIndex: 1

      Attachments

        Activity

          People

            adobejira Adobe JIRA
            adobejira Adobe JIRA
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: