@Denis, I think you were correct for the first part of the problem, by
explicitly defining that its an objects seems to stop it throwing the
exception. :-)
However.....
@ Jeff, you seem to have hit the nail with the next problem, it now
seems that my object fails validation on every attempt because the
properties are not defined. I have to explicitly define a getFoo()
method in the bean for Validat to be able to help, this obviously
negates some of the lovely benefits for using Transfer, My Decorator
looks like this at the moment.
<cfcomponent displayname="company" output="false"
extends="transfer.com.TransferDecorator">
<cfproperty name="Company_ID" type="string" default="" />
<cfproperty name="Name" type="string" default="" />
<cfproperty name="Created" type="date" default="" />
<cfproperty name="Modified" type="date" default="" />
<!--- Set the validate data validation engine into this bean. --->
<cffunction name="setValidat" access="public" output="false"
returntype="void" hint="I set the validat data validation engine into
this bean.">
<cfargument name="Validat" required="true" type="validat.validat"
hint="I'm the validat data validation engine." />
<!--- Set the validt property --->
<cfset VARIABLES.Instance.Validat = ARGUMENTS.Validat />
<!--- Return Void --->
<cfreturn />
</cffunction>
<!--- I validate the objects properties. --->
<cffunction name="validate" access="public" returntype="any"
output="false" hint="I validate the bean.">
<!--- Create A Temporary Local Structure --->
<cfset var LOCAL = structNew() />
<!--- Validate the bean against validat --->
<cfset LOCAL.ErrorCollection = VARIABLES.Instance.Validat.validate
("company", THIS).getErrors() />
<!--- Return the error collection --->
<cfreturn LOCAL.ErrorCollection />
</cffunction>
</cfcomponent>
Can you think of any reason why the properties would'nt be visible to
validat? after all the decorator wraps the transfer object which has
the getter methods, I'm guessing they're not exposed to Validat in the
way which is needed.
This could be a bit of a bugger.
Rob