Hello:
I have a CFC with a remote function and am trying to populate it into my cfm page's cfselect element. But I am not getting anything in the select.
I tried executing the cfc directly, but the method that I call does not execute.
Here is the code for the CFC:
<cfcomponent output="false">
<cffunction name="getYear" access="remote" returnType="query">
<cfset yearlist = QueryNew("yr","integer")>
<cfset temp = QueryAddRow(yearlist,3)>
<cfset counter = 1>
<cfloop from="#evaluate(year(Now())-1)#" to="#evaluate(year(Now())+1)#" index="y">
<cfset temp = QuerySetCell(yearlist,"yr",y,counter)>
<cfset counter = counter + 1>
</cfloop>
<cfreturn yearlist>
</cffunction>
</cfcomponent>
Here is the code for the CFM
<body>
<cfform>
<table>
<tr>
<td>Select Year:</td>
<td><cfselect name="yearval"
bind="cfc:cfc.ajaxcomp.getYear()"
value="yr"
display="yr"
bindonload="true" /></td>
</tr>
</table>
</cfform>
</body>
Could you please tell me what am I missing here?
Thanks!