Hmm, very odd, that makes sense, because my response went to flexcoders. Maybe it was really just my mailreader failed to move the message into the flexcoders folder.
Whatever, at least I was polite in my rebuff! 99.99 percent of posters understand the protocol, but I am firm with those few that don't. Tracy ________________________________ From: [email protected] [mailto:[EMAIL PROTECTED] On Behalf Of Robb Cundick Sent: Tuesday, January 30, 2007 11:28 AM To: [email protected] Subject: RE: [flexcoders] RE: ItemRenderer Problem Hmmm... I re-checked and I did indeed send my original message to [EMAIL PROTECTED] <mailto:[EMAIL PROTECTED]> Perhaps you received a private copy because I'm a new member of the list? ________________________________ From: [email protected] [mailto:[EMAIL PROTECTED] On Behalf Of Tracy Spratt Sent: Tuesday, January 30, 2007 9:18 AM To: [email protected] Subject: [flexcoders] RE: ItemRenderer Problem I don't answer private requests for help (for free, that is). I am very willing to try to help, but I require that my work benefit the entire community, not just one person. Take this question ot one of the public lists like flexcoders or the Adobe forums. Tracy ________________________________ From: [email protected] [mailto:[EMAIL PROTECTED] On Behalf Of Robb Cundick Sent: Tuesday, January 30, 2007 1:00 AM To: [email protected] Subject: ItemRenderer Problem Hello, I'm a Flex newbie in need of some help. I'm grabbing an array of data from a Web service and displaying it in a List component. On the Flex side I store the data in an ArrayCollection, the name of which I set as the Data Provider for my list. I have a field called "Display" which I set as the List's labelField. Everything works fine, but then I wanted to get a little fancier and vary the color of each line based on another field called "MemberStatus." To do that I wrote an ItemRenderer component which contains a label that I use to vary the text display. In the itemRenderer I override the "set data" function, expecting that I can then use the supplied Object parameter to reference both the "Display" field to set as the text of the label, and the "MemberStatus" field to determine the text color I want for the label. Unfortunately, things don't work as I think they should. If I override "set data" as follows: override public function set data(oItem:Object):void { displayItem.text = oItem.Display; (Followed by additional code using oItem.MemberStatus to determine the color) } I get the following error: ReferenceError: Error #1069: Property Display not found on String and there is no default value. at memberListRenderer/set data() at mx.controls::List/http://www.adobe.com/2006/flex/mx/internal::setupRende rerFromData() at mx.controls::List/measureWidthOfItems() at mx.controls::List/mx.controls:List::commitProperties() at mx.core::UIComponent/validateProperties() at mx.managers::LayoutManager/::validateProperties() at mx.managers::LayoutManager/::doPhasedInstantiation() at Function/http://adobe.com/AS3/2006/builtin::apply() at mx.core::UIComponent/::callLaterDispatcher2() at mx.core::UIComponent/::callLaterDispatcher() Here's a sample of the output of the web service: <?xml version="1.0" encoding="utf-8" ?> <ArrayOfMemberSearchList xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance <http://www.w3.org/2001/XMLSchema-instance> " xmlns:xsd="http://www.w3.org/2001/XMLSchema <http://www.w3.org/2001/XMLSchema> " xmlns="http://tempuri.org/ <http://tempuri.org/> "> <MemberSearchList> <ID>414</ID> <Display>Doe, Jane</Display> <MemberStatus>O</MemberStatus> </MemberSearchList> <MemberSearchList> <ID>109</ID> <Display>Smith, John</Display> <MemberStatus>C</MemberStatus> </MemberSearchList> </ArrayOfMemberSearchList> If I just insert the above data exactly "as is" in a test program as type mx:Model I have no problem; the oItem.Display and oItem.MemberStatus fields are "legal" and yield the results I want. But when I use the web service I get the error. I can set the label in the itemRenderer to have a data provider of {data.Display} and it works using the web service. But that doesn't do me any good because I have no way to access the MemberStatus field and alter the color. Obviously the problem has something to do with the oItem field in "set data" not being what I think it is. Does anyone know what I'm doing wrong? TIA, Robb

