There's a method in one of my components componentValitation.cfc:
<cffunction name="getValidationTypeRegExpByID" access="public"
returntype="string" output="false">
<cfargument name="componentValidationTypeID" type="numeric" required="true">
<cfscript>
if (structKeyExists(variables.componentValidationTypes, arguments.componentValidationTypeID))
{
return variables.componentValidationTypes[arguments.componentValidationTypeID].RegExp;
}
return '';
</cfscript>
</cffunction>
I want to call the above mentioned method from another component. I tried calling it from common.cfc like this
var advertisement = getComponentValidation('component','sys.jo.core.fe.componentValidation');
<cfset testttt = advertisement.getValidationTypeRegExpByID(componentValidationTypeID) />
<cfset errorMessage = "#componentShortLabel# #Lib.showCaption('message_Decimal2dpValidation', UserIdentity)#" />
<cfset arguments.Message.addValidationError( keyName=QuestionID, errorMessage=errorMessage, componentKey=ComponentID, componentErrorMessage=errorMessage, tupleIndex=arguments.tupleIndex, QuestionDisplayNumber=errorDisplaySequenceNumber ) />
But I'm getting an error like Elementcomponent is not defined in variable in componentValidation.cfc (which was already defined in my init() function). Any ideas?
This is probably a mistake:
Shouldn't it be: