Anyone got a simple example for me to bind a query from a cfc to a datagrid.

 

I can’t get it to work and the documentation on integrating CF & Flex is seriously lacking or hiding.

 

Here’s what I’ve got which works, except no data goes in the grid.

 

<?xml version="1.0" encoding="utf-8"?>

 

<!-- Define Web Service -->

<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute">

     <mx:WebService id="accountWs" wsdl="http://localhost/flex/SimpleTest/account.cfc?wsdl" showBusyCursor="true">

           <mx:operation name="getAccounts" result="accountArray = event.result as Array;" />

     </mx:WebService>

     <mx:Script>

           <![CDATA[

                private function update():void {

                     accountWs.getAccounts();

                }

 

                [Bindable]

                public var accountArray:Array;

           ]]>

     </mx:Script>

     <!-- Define the bindings -->

     <mx:Binding source="accountWs.getAccounts.result"

            destination="accountGrid.dataProvider" />

    

     <mx:TabNavigator y="10" height="541" width="100%" x="10">

           <mx:Canvas label="Account" width="100%" height="100%">

                <mx:DataGrid id="accountGrid" x="10" y="45" width="100%" height="245" dataChange="{accountArray}" >

                     <mx:columns>

                           <mx:DataGridColumn headerText="Id" width="50" dataField="ACCOUNTID" />

                           <mx:DataGridColumn headerText="Account Name" dataField="ACCOUNTNAME" />

                           <mx:DataGridColumn headerText="Description" dataField="DESCRIPTION" width="80" textAlign="right"/>

                     </mx:columns>

                </mx:DataGrid>

                <mx:TextInput x="90" y="10" width="172"/>

                <mx:Text x="10" y="12" text="Keywords:" width="72"/>

                <mx:Button x="277" y="10" label="Search" click="update();"/>

           </mx:Canvas>

           <mx:Canvas label="Users" width="100%" height="100%">

           </mx:Canvas>

           <mx:Canvas label="Notes" width="721" height="299">

                <mx:Button x="217" y="142" label="Button"/>

           </mx:Canvas>

     </mx:TabNavigator>

</mx:Application>

 

 

Regards
Dale Fraser

http://dale.fraser.id.au


 

 


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "cfaussie" group.
To post to this group, send email to cfaussie@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/cfaussie
-~----------~----~----~----~------~----~------~--~---

Reply via email to