Thanks very much for the info, Clint. If I return a query instead of an array, do I still cast it as an ArrayCollection? It doesn't seem to be working for me. The other puzzling thing is that I can use my current code and use the result as the data provider for a grid, and it works perfectly...it's just when I try to use it as a data provider for a list, it doesn't work.
--- In flexcoders@yahoogroups.com, "Clint Tredway" <[EMAIL PROTECTED]> wrote: > > Web services are not returned liked that. My advice is to use remoting with > CF and your code will work the way it is now.. also, you can return the > query itself without making an array to send back. > > On 1/17/07, Lisa Lee <[EMAIL PROTECTED]> wrote: > > > > Hi, > > > > I have a list that I want to populate with data from a CFC, but all I > > get with my current code is a list with every row reading '[object > > Object]' instead of actual data from my web service. The web service > > should just be returning an array (also, is an array the best way to > > return data for a list?). > > > > Main code of CFC that returns data: > > > > <cfquery name="GetServiceTypes" datasource="STO5"> > > SELECT > > pkServiceTypeID, > > Description > > FROM tblSYS_ServiceTypes WITH (NOLOCK) > > ORDER BY Description > > </cfquery> > > > > <cfset ServiceTypeArray = ArrayNew(1)> > > > > <cfoutput query="GetServiceTypes"> > > <cfset ServiceTypeArray[CurrentRow] = StructNew()> > > <cfset ServiceTypeArray[CurrentRow].serviceTypeID = > > pkServiceTypeID> > > <cfset ServiceTypeArray[CurrentRow].description = Description> > > </cfoutput> > > > > <cfreturn ServiceTypeArray> > > > > Main elements of MXML that pertain to the list: > > > > <?xml version="1.0" encoding="utf-8"?> > > <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" > > layout="absolute" > > creationComplete="perfManWS.GetServiceTypes.send();"> > > <mx:Script> > > <![CDATA[ > > [Bindable] private var serviceTypeDP:ArrayCollection; > > > > private function serviceTypeHandler(event:ResultEvent):void { > > serviceTypeDP = (event.result as ArrayCollection); > > } > > ]]> > > </mx:Script> > > > > <mx:WebService id="perfManWS" > > > > wsdl="http://development/dev1/workspaces/lisa/components/perfo > > rmancemanagement.cfc?wsdl"> > > <mx:operation name="GetServiceTypes" > > result="serviceTypeHandler(event)"> > > <mx:request> > > <UName>xxx</UName> > > <UPassword>xxx</UPassword> > > </mx:request> > > </mx:operation> > > </mx:WebService> > > > > <mx:List id="stComboList" > > > > dataProvider="{serviceTypeDP}" > > > > labelField="description" > > > > allowMultipleSelection="true"/> > > > > </mx:Application> > > > > > > > > > > -- > http://indeegrumpee.spaces.live.com/ >