I think that the objects in your dataProvider
must implement the IUID interface for selection to work. From: Hello, I was just converting a project from Beta1
to Beta2 and noticed a problem with all my List components that were bound to
data providers which are collections of custom objects. The problem is that the List selection
highlight is stuck on the last item in the list. Changing the provider to
be an array collection made up of plain instances of the Object class fixes the
problem. The problem seems to effect anything that uses the List
component (ComboBox, DataGrid…) Has anyone else seen this and found a
fix? Using plain old Object instances are not an option. Here is some sample code that shows the
problem. <?xml version="1.0"
encoding="utf-8"?> <mx:Application
xmlns:mx="http://www.adobe.com/2006/mxml" xmlns="*"
layout="absolute" preinitialize="initData()">
<mx:Script>
<![CDATA[
[Bindable]
public var a:Array;
private function initData():void {
a = new Array();
var myObj:MyObject = new MyObject();
myObj.name = "neung";
a.push(myObj);
var myObj2:MyObject = new MyObject();
myObj2.name = "saawng";
a.push(myObj2);
var myObj3:MyObject = new MyObject();
myObj3.name = "saam";
a.push(myObj3);
}
]]>
</mx:Script>
<mx:List x="10" y="10" dataProvider="{a}"
width="200" height="200"
labelField="name"></mx:List> </mx:Application> //------ MyObject.as ----------------- package {
public class MyObject extends Object {
public var name:String;
} }
|
- RE: [flexcoders] List Component Bug!! Tobias Patton
- RE: [flexcoders] List Component Bug!! Lance Linder
- RE: [flexcoders] List Component Bug!! Gordon Smith
- [flexcoders] Re: List Component Bug!! Peter Blazejewicz
- RE: [flexcoders] List Component Bug!! Gordon Smith
- Re: [flexcoders] List Component Bug!! Carlos Rovira