That seemed to do the trick.

 

Wonder how many others will get stumped on that?  Seems there should have been some kind of error if your objects don’t implement IUID.  Maybe this will be addressed through better docs in the final release or better yet a run time error.

 

I would have just chalked that up as a bug and looked to see if it was fixed in the next release if you didn’t mention it!

 

Thanks so much for the suggestion!

 

 


From: flexcoders@yahoogroups.com [mailto:flexcoders@yahoogroups.com] On Behalf Of Tobias Patton
Sent: Monday, March 27, 2006 3:35 PM
To: flexcoders@yahoogroups.com
Subject: RE: [flexcoders] List Component Bug!!

 

I think that the objects in your dataProvider must implement the IUID interface for selection to work.

 


From: flexcoders@yahoogroups.com [mailto:flexcoders@yahoogroups.com] On Behalf Of Lance Linder
Sent: Monday, March 27, 2006 1:08 PM
To: flexcoders@yahoogroups.com
Subject: [flexcoders] List Component Bug!!

 

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;

            }

}





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




Reply via email to