Hi I'm getting this error below and not sure how to resolved it.
Detail:
Either there are no methods with the specified method name and argument types or the leaseService 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.
Message:
The leaseService method was not found.
I'm using fw1 3.1.1 and Adobe CF 9 on Windows 7 running on IIS 7.
My Framework-one structure (simplified)
Controllers
-property.cfc
-lease.cfc
Model/Beans
-property.cfc
-lease.cfc
Services
-property.cfc
-lease.cfc
Views/property
-detail.cfm
In my property controller I'm calling lease list function like so.
property propertyService;
property leaseService;
function detail(rc) {
rc.property = variables.propertyService.detail(id=rc.id);
rc.leases = variables.leaseService().list(propertyID=rc.id);
}
Here is my lease services:
component accessors=true {
function init( beanFactory ) {
variables.beanFactory = beanFactory;
return this;
}
function list(propertyID) {
var qData = new query();
qData.setDatasource(application.dsn);
qData.setName("qLease");
qData.addParam(name="propertyID", value="#rc.propertyID#", CFSQLTYPE="cf_sql_numeric");
qData.setSQL("
select l.id, l.fName, l.lName, l.leaseActive, l.leaseFrom, l.leaseTo, CONCAT(u.fname,' ',u.lname) pmName
from leases l inner join users u on l.pmID = u.id
where propertyID = :propertyID
order by LeaseTo DESC
");
qReturn = qData.execute();
result = qReturn.getResult();
return result;
}
}
Any suggestion would be much appreciated.
thank you!
You are calling leaseService
as a method. It's a variable. So instead of this:
rc.property = variables.propertyService.detail(id=rc.id);
rc.leases = variables.leaseService().list(propertyID=rc.id);
Do this:
rc.property = variables.propertyService.detail(id=rc.id);
rc.leases = variables.leaseService.list(propertyID=rc.id);
Note that I removed the ()
HTH