I'm trying to determine the best method to overwrite 'some' of the
record defaults without having to explicitly specify all of the
defaults. (because the Reactor assumed defaults are fine in many cases)
I've got a solution, but when it fails, it can be tough to track down
the cause. I think I picked up the following example from one of the
Reactor examples. Are you doing this differently? Is this the
recommended method?
The following code is placed at the top of the customizable
objectRecord.cfc to override the default init method.
<cffunction name="init" access="public" hint="I configure and return
this record object with custom defaults." output="false"
returntype="any" _returntype="reactor.project.tprc.Record.CourseRecord">
<!--- Set defaults that are different than the standard Reactor
generated defaults as a set of cfarguments --->
<cfargument name="lastUpdate" hint="I am the default value for the
lastUpdate field." required="no" type="any" _type="string"
default="#now()#" />
<!--- Invoke the default init method --->
<cfset super.init(argumentCollection=arguments) />
<!--- Update the defaults with the custom settings based on the
cfarguments above --->
<cfset setlastUpdate(arguments.lastUpdate) />
<cfreturn this />
</cffunction>
Thank you for any insight you may be able to provide,
Dan
-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
Reactor for ColdFusion Mailing List
[email protected]
Archives at: http://www.mail-archive.com/reactor%40doughughes.net/
-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --