I'm creating a cascading select drop dwon with ColdFusion ajax from Ben Forta:
http://forta.com/blog/index.cfm/2007/5/31/ColdFusion-Ajax-Tutorial-2-R elated-Selects
But it is not entirely working. The first drop down works and shows the countries in a drop down but the second drop down doesn't show the related States!
I did some googling and found out that this is a problem of CF8 (?) because I'm using Application.cfc
To get around this, I found Ray Camden's blog that said the following:
There is a way around it. Sean Corfield has a nice little work around that involves adding the following code to your onRequestStart (not onRequest, but onRequestStart):
1<cfif listlast(arguments.thePage,".") is "cfc">
2<cfsetStructDelete(this, "onRequest") />
3<cfsetStructDelete(variables,"onRequest")/>
4</cfif>
I already put this code on my OnRequest function in my Application.cfc but I don't quite understand what is .thePage actually mean??
I replaced argument.thePage with argument.Name_of_My_cfc which is AjaxCountryProvince:
But simply added this code like this (see below), it is still not working. Please help!!
<cffunction name="onRequestStart" returnType="string" output="false">
<cfif ListLast(arguments.AjaxCountryProvince,".") is "cfc">
<cfset StructDelete(this, "onRequest") />
<cfset StructDelete(variables,"onRequest")/>
</cfif>
<cfset request.mySecretKey = application.mySecretKey />
<cfset request.algorithm = "AES" />
<cfset request.encoding = "hex" />
</cffunction>
Please advice, I've been stucked with this functionality for two weeks