Re: [flexcoders] List Component Bug!!

2006-03-28 Thread Carlos Rovira



Try to use an bindable ArrayCollection as your dataProvider that uses your array. (see the docs for an example).On 3/28/06, Gordon Smith 
[EMAIL PROTECTED] wrote:
















I'm not sure why an Array of Objects
doesn't work, but let's see if Alex Harui
does.



However, I do want to point out that
writing



 public var a:Array = [ { name:
nueng }, { name: saawng }, { name: saam }
];



will produce smaller and faster code than what
you're doing in initData().



- Gordon











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



  Visit your group flexcoders on the web.

  To unsubscribe from this group, send an email to:
[EMAIL PROTECTED]
  Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service
.



  










-- ::| Carlos Rovira::| http://www.carlosrovira.com






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



  Visit your group "flexcoders" on the web.
  To unsubscribe from this group, send an email to:[EMAIL PROTECTED]
  Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.



  









RE: [flexcoders] List Component Bug!!

2006-03-27 Thread Tobias Patton










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








  
  
SPONSORED LINKS
  
  
  

Web site design development
  
  
Computer software development
  
  
Software design and development
  
  


Macromedia flex
  
  
Software development best practice
  

   
  







  
  
  YAHOO! GROUPS LINKS



  Visit your group "flexcoders" on the web.
  To unsubscribe from this group, send an email to:[EMAIL PROTECTED]
  Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.



  











RE: [flexcoders] List Component Bug!!

2006-03-27 Thread Lance Linder










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



  Visit your group "flexcoders" on the web.
  To unsubscribe from this group, send an email to:[EMAIL PROTECTED]
  Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.



  











RE: [flexcoders] List Component Bug!!

2006-03-27 Thread Gordon Smith










My understanding is that you have to
implement IUID if your dataProvider items are a custom class. If they're a
plain Object, I don't think you have to. What's the story, Alex?



- Gordon











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





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



  Visit your group "flexcoders" on the web.
  To unsubscribe from this group, send an email to:[EMAIL PROTECTED]
  Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.