Tuesday, January 23, 2007

Issues with the Coldfusion Wizards

I have noticed a few gotchas with the Coldfusion Wizards for Flex 2. In this post I want to talk about the issue I have found with the save method in the gateway CFC that is created when you generate an Active Record CFC type from a database table. This is the save method that is created:

<cffunction name="save" output="false" access="remote">
<cfargument name="obj" required="true" />
<cfreturn obj.save() />
</cffunction>

This works so far as it will save the object to the database, but it fails to return the object to the result method in Flex. After some banging around I modified the code to the following:

<cffunction name="save" output="false" access="remote">
<cfargument name="obj" required="true" />
<cfset obj.save() />
<cfreturn obj />
</cffunction>

This saves the object to the database AND returns the object back to Flex. Now if I can figure out if it is possible to modify the way the Coldfusion Wizards write code I can save myself alot of copy and paste! If anyone knows drop me a line.

No comments: