从组件(cfc)调用用户定义的函数不起作用
我正在标记内调用函数 (JoblistAdd)。
请参阅 Index.cfm 中的以下代码
<cfajaxproxy cfc="TimesheetHours" jsclassname="js_TimesheetHours">
<script >
var obj_TimesheetHours = new js_TimesheetHours();
var strMsglist=
obj_TimesheetHours.JoblistAdd(selectedJobArray,userID,weekending,tsApproved);
</script>
,组件代码 TimesheetHours.CFC
<cffunction name="JoblistAdd" >
<cfargument name="AddList" required="yes" >
<cfargument name="userID" required="yes" >
<cfargument name="weekending" required="yes" >
<cfargument name="Approved" required="false" >
<cfset JobArray =arguments.AddList>
<cfset userID =arguments.userID>
<cfset weekending =arguments.weekending>
<cfset tsApproved =arguments.Approved>
<cfdump var="#JobArray #"><cfabort>
</cffunction>
但我无法到达转储, 我认为它不在函数内部,请分享您的想法
I am calling the function (JoblistAdd) inside the tag.
See the below code in Index.cfm
<cfajaxproxy cfc="TimesheetHours" jsclassname="js_TimesheetHours">
<script >
var obj_TimesheetHours = new js_TimesheetHours();
var strMsglist=
obj_TimesheetHours.JoblistAdd(selectedJobArray,userID,weekending,tsApproved);
</script>
Below , component code TimesheetHours.CFC
<cffunction name="JoblistAdd" >
<cfargument name="AddList" required="yes" >
<cfargument name="userID" required="yes" >
<cfargument name="weekending" required="yes" >
<cfargument name="Approved" required="false" >
<cfset JobArray =arguments.AddList>
<cfset userID =arguments.userID>
<cfset weekending =arguments.weekending>
<cfset tsApproved =arguments.Approved>
<cfdump var="#JobArray #"><cfabort>
</cffunction>
But i could not able to reach till the dump ,
I think it is not coming inside the function , Please share your thoughts
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
Arasu,
您必须将访问属性指定为“远程”。就您而言,它是默认公开的。
希望有帮助。
Arasu,
You have to give the access attribute as 'remote'. In your case its by defualt public.
hope that helps.