Hi
Tarik,
Please
ignore my previous messages. I was able to get it working. I
misunderstood the capitalization advice. I had capitalized the entire
field, when only the first letter needed to be.
A
couple of follow-up questions, if you don't mind:
- I see contrary advice on how to return data from CF. Some say through an array and others just take the recordset directly. Which would you consider best practice? I want to settle on a standard as I build out my first Flex app.
- In the RemoteObject tag, is it better to just pass the event to a function (i.e., fault="doFault(event)" result="doResult(event)") or through more implicit calls (i.e., fault="mx.controls.Alert.show(event.fault.faultstring) <mx:method name="doResult" result="handleResult(event)"). Again, I'm just looking for a best practice I can standardize on.
Thank
you,
Darius
-----Original Message-----Hi Darius, welcome.
From: [email protected] [mailto:[EMAIL PROTECTED]On Behalf Of Tarik Ahmed
Sent: Thursday, July 21, 2005 6:28 PM
To: [email protected]
Subject: Re: [flexcoders] Flex and CFCs -- problems displaying recordsets in datagrids
Some things to keep in mind:
- CF and it's CFCs are not case sensitive, where as Flex is. Eg if you
do a CFQUERY and just send the results back, all the fields will be
upper case.
- I think on your doResult you'll need output.dataProvider =
event.result._items;
Here's some articles that should help you out:
http://www.bpurcell.org/blog/index.cfm?mode=entry&entry=1019
http://www.richinternet.de/blog/index.cfm?entry=831FE26E-0D70-9C2D-2549E1D1978CF1B0
coldfs wrote:
>Hi,
>
>I'm new to Flex and have been working over the last few weeks to
>integrate this product with CF. One of my central aims is to be able
>to pass data from Flex to a CFC which houses a query and will return
>a recordset back to Flex. Through piecing together examples here and
>there, I've figured out how to call the CFC and send data to it from
>Flex, but I've been unable to figure out how to display the recordset
>in a Flex datagrid. Any help/examples, best practices, on how to do
>this would be greatly appreciated. My existing code follows. The
>query recordset returns two fields. The error I receive is:
>
>1 Error found.
>
>Error /FlexToCFC2.mxml:19
>There is no property with the name 'text'.
>
>--------------------------------------------------
>
>
><?xml version="1.0" encoding="utf-8"?>
><mx:Application xmlns:mx="http://www.macromedia.com/2003/mxml"
>xmlns="*">
>
> <mx:Script>
> <![CDATA[
>
> private function doClick():Void{
> ro.GetUpdateAuthorization(input.text);
> }
>
> private function doResult(event:Object):Void{
> output.text = event.result;
> }
>
> private function doFault(event:Object):Void{
> alert("Error invoking CF: " +
>event.fault.faultstring);
> }
>
> ]]>
> </mx:Script>
>
> <mx:RemoteObject id="ro"
>endpoint="http://gx270dev.childsupport.net/flashservices/gateway"
>
> source="Model.mUtilities.mUpdate.qry_UpdateAuthorization"
> fault="doFault(event)"
> result="doResult(event)">
>
> </mx:RemoteObject>
>
> <mx:Panel title="Updates">
> <mx:Form defaultButton="sendButton">
> <mx:FormItem label="Input:"
>direction="horizontal">
> <mx:TextInput id="input"/>
> <mx:Button id="sendButton"
>label="Send" click="doClick()"/>
> </mx:FormItem>
> <mx:DataGrid id="output" width="520"
>wordWrap="true">
> <mx:columns>
> <mx:Array>
> <mx:DataGridColumn width="200"
>headerText="Update Form" columnName="Function"/>
> <mx:DataGridColumn width="320"
>headerText="Description" columnName="Description"/>
> </mx:Array>
> </mx:columns>
> </mx:DataGrid>
> </mx:Form>
> </mx:Panel>
>
></mx:Application>
>
>
>Many thanks,
>Darius
>
>
>
>
>
>
>
--
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.

