Hi Allen,
 
I'm very interested in learning how you achieved this.  I continue to be confused by all varying syntax one can use to access data using AMF.  It looks like your approach is certainly a best practice.  Do you have an example you could share of your cfc, mxml, and actionscript.  I just need one good sample to get off and running.
 
Many thanks,
Darius
-----Original Message-----
From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED]On Behalf Of Allen Manning
Sent: Friday, July 22, 2005 1:23 AM
To: flexcoders@yahoogroups.com
Subject: RE: [flexcoders] Flex and CFCs -- problems displaying recordsets in datagrids

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




Reply via email to