Hi All,I'm new in Cfwheel If i'm trying to use error function hasError() getting issue , please let me know/controller/cfc file<cffunction name="Create"><cfset emphis = model("EMP_HISTORY").new(params.emphis)><cfset emphis = emphis.save()><cfif emphis.hasErrors()><cfset renderPage(action="emp")></cfif></cffunction>/model/cfc file<cfcomponent displayname="emp model" extends="model"><cffunction name="init"><cfset table("EMP_HISTORY")><cfset validatesPresenceOf("ID,COM_NAME")></cffunction></cfcomponent>I'm getting following errorThe hasErrors method was not found. | |
| Either there are no methods with the specified method name and argument types or the hasErrors method is overloaded with argument types that ColdFusion cannot decipher reliably. ColdFusion found 0 methods that match the provided arguments. If this is a Java object and you verified that the method exists, use the javacast function to reduce ambiguity. | |
| The error occurred inC:/ColdFusion11/cfusion/wwwroot/cf_on_wheels/controllers/Emp.cfc: line 12 Called from C:/ColdFusion11/cfusion/wwwroot/cf_on_wheels/wheels/global/cfml.cfm: line 174 Called from C:/ColdFusion11/cfusion/wwwroot/cf_on_wheels/wheels/controller/processing.cfm: line 85 Called from C:/ColdFusion11/cfusion/wwwroot/cf_on_wheels/wheels/controller/processing.cfm: line 60 Called from C:/ColdFusion11/cfusion/wwwroot/cf_on_wheels/wheels/dispatch/request.cfm: line 167 Called from C:/ColdFusion11/cfusion/wwwroot/cf_on_wheels/wheels/index.cfm: line 1 Called from C:/ColdFusion11/cfusion/wwwroot/cf_on_wheels/index.cfm: line 1 Called from C:/ColdFusion11/cfusion/wwwroot/cf_on_wheels/wheels/events/onrequest.cfm: line 1 | |
10 : <cfset emphis = model("EMP_HISTORY").new(params.emphis)>
11 : <cfset emphis = emphis.save()>
12 : <cfif emphis.hasErrors()>
13 : <cfset renderPage(action="emp")>
14 : </cfif> | |
--
You received this message because you are subscribed to the Google Groups "ColdFusion on Wheels" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cfwheels+u...@googlegroups.com.
To post to this group, send email to cfwh...@googlegroups.com.
Visit this group at http://groups.google.com/group/cfwheels.
For more options, visit https://groups.google.com/d/optout.
You're setting emphis to a true/false value. That will not have a hasErrors() method.
Consider rewriting as such:
--
You received this message because you are subscribed to the Google Groups "ColdFusion on Wheels" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cfwheels+u...@googlegroups.com.
To post to this group, send email to cfwh...@googlegroups.com.
Visit this group at http://groups.google.com/group/cfwheels.
For more options, visit https://groups.google.com/d/optout.