Web Design Resources & Tutorials to help you design the best website!
First thing you need is the ColdFusion 8 Extensions for Eclipse.





<!– ColdFusion specific RTMP channel –>
<!–
<channel-definition id=”cf-rtmp” class=”mx.messaging.channels.RTMPChannel”>
<endpoint uri=”rtmp://{server.name}:2048″ class=”flex.messaging.endpoints.RTMPEndpoint”/>
<properties>
<idle-timeout-minutes>20</idle-timeout-minutes>
<serialization>
<instantiate-types>false</instantiate-types>
</serialization>
</properties>
</channel-definition>
–>

<!-- ======================================== --> <!-- ColdFusion - DataManagement sample application --> <!-- ======================================== --> <!-- Use the ColdFusion adapter for any CF specific destinations --> <!-- Use the ColdFusion configured channels which have the instantiate-types flag set to false. --> <!-- The component name or path on the CF server --> cfusion.DataPushSample.src.exhd.cfc.ARTAssembler <!-- Either "application" or "request" --> application <!-- Should we look for "getFoo" or "setFoo" when translating an ActionScript object to a CFC? If not found, the value is set in the "this" scope. If your CFCs don't have getters and setters, (they use the this scope) set this to false for better performance. Optional, Default is true - look for accessor functions. --> true <!-- Should we create CFML Structures instead of value objects when translating an ActionScript object with a remote alias? Optional, Default is false (use CFCs) --> false <!-- The hostname or IP address of the CF host. If Data Services is installed as part of CF, you omit this. If Data Services runs outside of CF, you must define this. <hostname>localhost</hostname> --> <!-- This is the ID of the ColdFusion Data Management service as configured in the ColdFusion Administrator. Only needed if you have more than one instance of CF on a machine and Data Services is not installed as part of CF. <identity>default</identity> --> <!-- Credentials to pass to the assembler CFC for all clients Generally better to use setRemoteCredentials() API on client <remote-username></remote-username> <remote-password></remote-password> --> <!-- Define the resolution rules and access level of the cfc being invoked --> <!-- allow "public" (and remote) or just "remote" methods to be invoked --> remote <!-- Optional controls for forcing property names to lowercase when converting to ActionScript --> <!-- cfc property names --> false <!-- Query column names --> false <!-- struct keys --> false <!-- Optional, If the Assembler fill routine returns a query, you must define an Actionscript type for the rows. <query-row-type>samples.contact.Contact</query-row-type> --> <!-- Add network elements here --> <!-- The method declarations are ignored for CFC Assemblers, with the exception of the fill-method settings. No parameters are defined here, unlike Java. Any arguments provided via the AS call are passed along to the CFC, just use optional arguments when defining the CFC. --> <!-- Does the assembler have a "fill-contains" method? This method is used to determine whether to refresh the fill. If the specified method returns true the fill is re-executed after a create or update. Auto-refresh determines if the fill is always refreshed if not specified. May only be used when auto-refresh is true. Optional. Default is false. --> false <!-- Determines whether to refresh the fill on updates or creates. Optional. Default value is true. --> true <!-- Determines whether order is important for this filled collection. Allows for performance optimization when order is not important. Optional. Default value is true. --> true
<?xml version="1.0" encoding="utf-8"?> <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="vertical" creationComplete="initApp()" viewSourceURL="srcview/index.html"> <mx:Script> <![CDATA[ import exhd.action.ART; import mx.collections.ArrayCollection; [Bindable] private var myGridData:ArrayCollection = new ArrayCollection(); /** * @private * This Is a Dummy Variaiable, You MUST Include it otherwise Flex * *Will not Compile the Class and You will get an Error of * [RPC Fault faultString="Error during update: The OLDBEAN argument passed to the update * function is not of type foo." faultCode="null" faultDetail="null"] */ private var dummyVariableToCompile:ART = new ART(); private function initApp():void { myDataService.fill(myGridData); } ]]> </mx:Script> <mx:DataService destination="cfartgallery" autoCommit="true" id="myDataService" /> <mx:Text text="If You Are Not Convinced that it works, You can always refresh the page to see that it has been commited to the DataBase"/> <mx:HBox> <mx:Panel title="DataBase That Uses DataService to Update in RealTime" > <mx:DataGrid dataProvider="{myGridData}" width="500" height="600" editable="true"> <mx:columns> <mx:DataGridColumn dataField="ARTID" editable="false"/> <mx:DataGridColumn dataField="ARTISTID" editable="false"/> <mx:DataGridColumn dataField="ARTNAME" editable="true"/> <mx:DataGridColumn dataField="DESCRIPTION" editable="true"/> <mx:DataGridColumn dataField="PRICE" editable="true"/> <mx:DataGridColumn dataField="LARGEIMAGE" editable="true"/> <mx:DataGridColumn dataField="MEDIAID" editable="true"/> </mx:columns> </mx:DataGrid> </mx:Panel> <mx:Panel title="Dummy Sync to show it works" > <mx:DataGrid dataProvider="{myGridData}" width="500" height="600"/> </mx:Panel> </mx:HBox> </mx:Application>

Most Common Errors and Their Solution
[RPC Fault faultString="Error during update: The OLDBEAN argument passed to the update
function is not of type foo." faultCode="null" faultDetail="null"]
private var dummyVariableToCompile:ART= new ART();

8 Responses to understanding flex data management by using coldfusion livecycle
need search ranking k bai
July 16th, 2008 at 12:42 pm
[...] http://sherifabdou.com/2008/07/understanding-flex-data-management-by-using-coldfusion-livecycle/ [...]
Rob
July 23rd, 2008 at 10:00 am
Hi Sherif
I Keep getting this error.
Configuration error encountered on line 1, column 8: ‘The processing instruction target matching “[xX][mM][lL]” is not allowed.’ DataPushSample Unknown
No Idea What its supposed to mean.
Rob
Sherif
July 23rd, 2008 at 2:26 pm
There is some white space before the document declaration in your CFC File make sure that there is nothing before tag or whatever is first, here is a link for more http://www.bennadel.com/blog/58-The-Processing-Instruction-Target-Matching-xX-mM-lL-is-Not-Allowed.htm
Bookmarks about Management
July 29th, 2008 at 8:00 am
[...] – bookmarked by 3 members originally found by toufonne on July 16, 2008 Understanding Flex Data Management by using ColdFusion & LiveCycle http://sherifabdou.com/2008/07/understanding-flex-data-management-by-using-coldfusion-livecycle/ – [...]
Frank Gonzalez
September 16th, 2008 at 12:17 pm
Hi,
This is great tutorial. First, I downloaded your code but there are things missing. Namely the window component. I was able to modify to work without the missing code, but now when I compile and run, nothing happens..no errors or anything. The grids appear on the browser but no data is displayed. Please bear in mind that I do not know anything on what I need to do to set up Livecycle. So, could you please email me the complete codeset and let me know if there’s anyway you could help me diagnose my problem. As a sidenote, I noticed on a previous version of Flex (version 2), there is a Livecycle Data Services ES 2.5.1 comes up as an option when on my Programs launch bar. I’m trying to run version 3 of Flex on a different box, and it does not contain this. Could this be the problem?
Thanks
Frank
Sherif
September 16th, 2008 at 1:14 pm
Add a Fault Handler and see if you get anything. I deleted the Code set a while ago so sorry. Also make sure when you create a new Flex Project you selected Application Server Type–>ColdFusion and LiveCycle Data Services for the use remote objects.
Paul Kukiel
September 27th, 2008 at 7:29 pm
This was a great code sample. If you move this to a server rather then just running locally make sure you open port 2048 or push will revert to polling ( over port 80 ). The same goes if your local firewall blocks port 2048 outgoing.
Tom
May 13th, 2009 at 2:51 pm
Your example worked well–THANKS! But when I tried doing the same w/other tables "artists" (in cfartgallery) & another "users" table (that I have in a SQL db), I can maybe make 1 or 2 edit/changes thru Flex UI & then it throws Error: "Unknown Property: 'constructor'….at mx.collections::ListCollectionView… ListCollectionView.as:694]. Please help! Thanks.