1
点defided存在componentValitation.cfc一个方法,该方法是元素componentValidation在可变
**<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>**
我想调用上述方法在common.cfc 即时得到像Elementcomponent误差在变量未定义在componentValidation.cfc
这已经定义在init()
函数中。
我试图调用common.cfc
这种方法如下面
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) />
如有疑问,请查看您的数据。如果您有一个名为'componentValidation.cfc'的变量,请将其转储并查看其中的内容。 –
@Dan Bracuk有variablevalidationtypes添加它给出正确的验证类型 –