|
Actually, if you're using 7.02, you're wasting bandwidth if
you consume CFC's via webservice instead of remoteobject. When you call a CFC
via a remoteobject, CF does all the conversions for you as the data passes
through the flashgateway.
Also, when you're binding data, you should always use an
ArrayCollection... using LastResult isn't reliable, according to
Adobe.
Shan From: [email protected] [mailto:[EMAIL PROTECTED] On Behalf Of ericonanson Sent: Monday, July 24, 2006 8:54 PM To: [email protected] Subject: [flexcoders] Re: Returning query results to flex from CFC
Using CF 7.02 and Datagrids is very easy now! Remember that the column names come through in CAPS. Example I wrote after the Flex Data Services session to test the speed of webservices. <?xml version="1.0" encoding="utf-8"?> <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute"><!-- setup the webservice to call --> <mx:WebService id="wsc" wsdl="http://www.getpaidtoseeads.com/seeEmail.cfc?wsdl" showBusyCursor="true" useProxy="false"><!-- this allows for a parameter to be passed I am sending the MaxRows parameter in the cfquery tag --> <mx:operation name="GetPostalCode"> <mx:request xmlns=""> <MaxRow>{cbxMaxRow.value} </MaxRow> </mx:request> </mx:operation></mx:WebService> <!-- this is a combo box to select the rows to bring in --> <mx:Button label="Get Records" click="wsc.GetPostalCode.send()" left="412" top="10"/> <mx:ComboBox id="cbxMaxRow" left="100" top="10"> <mx:Object label="100" value="100" /> <mx:Object label="500" value="500" /> <mx:Object label="1000" value="1000" /> <mx:Object label="10000" value="10000" /> <mx:Object label="20000" value="20000" /> <mx:Object label="40000" value="40000" /> </mx:ComboBox> <!-- here is the easy part! see how the dataprovider is the webservice no extra arraycollection needed Format is webservice id then method or function name then lastResult--> <mx:DataGrid id="dgEmail" width="816" height="469" dataProvider="{wsc.GetPostalCode.lastResult}" x="50" y="100"> <mx:columns> <!-- see how my dataField names are in caps it will not show data without that CF and FLex work that way --> <mx:DataGridColumn headerText="Subscriber" dataField="PKID"/> <mx:DataGridColumn headerText="Postal Code" dataField="POSTALCODE"/> <mx:DataGridColumn headerText="Province" dataField="PROVINCE"/> </mx:columns> </mx:DataGrid></mx:Application>
See if that makes life easier for you and all the CFer's out there. Kindest Regards,
Eric
-- -- 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
-- |
- RE: [flexcoders] Re: Returning query results to flex from ... Shannon Hicks
- Re: [flexcoders] Re: Returning query results to flex ... Douglas Knudsen

