Darius,

Rather than passing ColdFusion recordsets directly back to Flex, what we did
is transform the results into an array of CFCs or an array of structs and
let the automatic AS type translation transform these results into native AS
value objects.

I would be weary of too tightly coupling your Flex layer with the specifics
of your server side.

HTH,
Allen
www.prismix.com/



-----Original Message-----
From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On
Behalf Of coldfs
Sent: 22 July 2005 00:35
To: flexcoders@yahoogroups.com
Subject: [flexcoders] Flex and CFCs -- problems displaying recordsets in
datagrids

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



 





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

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/flexcoders/

<*> To unsubscribe from this group, send an email to:
    [EMAIL PROTECTED]

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/
 


Reply via email to