[ https://issues.apache.org/jira/browse/FLEX-24780?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Mark Kessler closed FLEX-24780. ------------------------------- > Initially I can change the selectedItem in a List programmatically, but if > the event preventDefault is called anytime, I can no longer change the > selectedItem programatically. > ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- > > Key: FLEX-24780 > URL: https://issues.apache.org/jira/browse/FLEX-24780 > Project: Apache Flex > Issue Type: Bug > Components: Spark: List > Affects Versions: Adobe Flex SDK 4.0 (Release) > Environment: Affected OS(s): All OS Platforms > Affected OS(s): All OS Platforms > Browser: Firefox 2.x > Language Found: English > Reporter: Adobe JIRA > Assignee: Mark Kessler > Fix For: Adobe Flex SDK Next > > > 1.Click the button. The selectedItem is changed programmatically. > 2.Click on the list. The changing handler is called, the preventDefault is > executed and the selectedItem is not changed. > 3.Click on the button again. The changing handler is executed and the > selectedItem does not change. > <fx:Script> > <![CDATA[ > import spark.events.IndexChangeEvent; > protected function myButton_clickHandler(event:MouseEvent):void{ > if(myList.selectedIndex == 0) myList.selectedIndex = 1; > else myList.selectedIndex = 0; > } > protected function > myList_changingHandler(event:IndexChangeEvent):void{ > event.preventDefault(); > } > ]] > > > </fx:Script> > <s:layout> > <s:VerticalLayout/> > </s:layout> > <s:Button id="myButton" label="Change selected index" > click="myButton_clickHandler(event)"/> > <s:List id="myList" changing="myList_changingHandler(event)"> > <s:ArrayCollection> > <fx:String>Item1</fx:String> > <fx:String>Item2</fx:String> > </s:ArrayCollection> > </s:List> > -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators For more information on JIRA, see: http://www.atlassian.com/software/jira