At the risk of invoking wrath from the "web services vs AMF" thread, if you're using ColdFusion, you probably shouldn't be using web services. You should be using Remote Objects (CF version 7.0.2 required).
 
I googled, and this was the best example I could come up with in 30 seconds:
 
Shan


From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of Oscar
Sent: Friday, August 25, 2006 10:42 AM
To: flexcoders@yahoogroups.com
Subject: [Junk E-Mail - LOW] [flexcoders] Re: Flex with Coldfusion Beginner


You can bind the result of your WebService to an ArrayCollection
and then use it as the dataprovider for your Datagrid. Here is a
simple of example of using an ArrayCollection as the datagrid
dataprovider.

<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml">

<mx:Script>
<![CDATA[

[Bindable]
public var myArray:Array =
[{colA:'A',colB:'B'},{colA:'A1',colB:'This is a test'}];
]]>
</mx:Script>

<mx:DataGrid id="myGrid" dataProvider="{myArray}"
width="100%" height="50%"
variableRowHeight="true" >
<mx:columns>
<mx:Array>
<mx:DataGridColumn dataField="colA"
headerText="Column A" width="70"/>
<mx:DataGridColumn dataField="colB"
headerText="Column B" width="50"/>
</mx:Array>
</mx:columns>
</mx:DataGrid>
</mx:Application>

--- In [EMAIL PROTECTED]ups.com, "plucka70" <[EMAIL PROTECTED]> wrote:
>
> I'm a real beginner, and know CF inside out. So I want to use Flex
> 2. I've read a bit online and got a webservice call working
> displaying the current time from a cfc.
>
>
>
> Now I have a cfc generated using the wizard which is a database
> related one, not sure what to do from here. I seems to generate an
> array of objects, and each object defines a row in the table, this
> all makes sense.
>
>
>
> But how do get this into a flex data grid.
>
>
>
> I assume I need to loop over the array and populate the data grid
> using an Action Script function. Conceptually simple, but I'm
hoping
> people can explain the best way to do this and perhaps post a
simple
> sample that takes a table into a data grid.
>
>
>
> PS: I'd rather not use the full generate wizards available, I'd
> rather learn how to do it line by line on the Flex side.
>
> Regards
> Dale Fraser
>
> http://dale.fraser.id.au
>


--
No virus found in this incoming message.
Checked by AVG Free Edition.
Version: 7.1.405 / Virus Database: 268.11.6/427 - Release Date: 8/24/2006

__._,_.___

--
Flexcoders Mailing List
FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com





SPONSORED LINKS
Software development tool Software development Software development services
Home design software Software development company


YAHOO! GROUPS LINKS




__,_._,___

--
No virus found in this outgoing message.
Checked by AVG Free Edition.
Version: 7.1.405 / Virus Database: 268.11.6/427 - Release Date: 8/24/2006

Reply via email to