cfc bind
I am trying to do a cfselect with bindonload with passing an optional parameter but i can't seem to get it to work, does anyone know if this is even possible or what i'm doing wrong. Any help is very much appreciated.
---------------------user.cfc------------------------------
<cffunction name="getStates" access="remote" returntype="array">
<cfargument name="customerState" type="string" required="no">
<cfset var getStateList="">
<cfset var result=ArrayNew(2)>
<cfset var i=0>
<!---Get data --->
<cfquery name="getStateList" datasource="#application.dsn#">
SELECT DISTINCT state
FROM tbl_zips
ORDER BY state
</cfquery>
<!--- Convert results to array --->
<cfloop index="i" from="1" to="#getStateList.RecordCount#">
<cfset result[1]=getStateList.state>
<cfset result[2]=getStateList.state>
</cfloop>
<cfif isDefined("arguments.customerState")>
<cfset ArrayPrepend(result[1][1],#arguments.customerState#)>
<cfset ArrayPrepend(result[1][2],#arguments.customerState#)>
</cfif>
<cfreturn result>
</cffunction>
==================Form================
<cfform action="test.cfm" method="post">
<table align="center">
<tr>
<td>
<cfif isDefined("customer.state")>
<cfselect name="state" bind="cfc:cfc.user.getStates({customer.state})" bindonload="true"/>
<cfelse>
<cfselect name="state" bind="cfc:cfc.user.getStates()" bindonload="true"/>
</cfif>
</td>
</tr>
</table>
</cfform>
