I love the new AJAX functionality in ColdFusion 8, but I am running into problems using it.
As mentioned in Ben Forta's blog you can use the BIND= attribute on a CFSELECT tag to populate the data from a CFC using AJAX.
The problem I had was that even using Ben's samples I could not get the data to populate. After alot of tinkering I finally got it to work by remove the onRequest() method from Application.cfc. Why this affects this functionality is a mystery to me. Really for the application I'm working on it's not a big problem but on other projects it could be.
My second part of the problem is that I have a cfc directory that is OUTSIDE of the application's root directory. For example:
/website_root
/components
/images
Then I map /cacfc to /components and reference my cfc's by prepending cacfc to the component IE. cacfc.database.data. This works great as I can share components among applications easily enough. But when I call the cfc with the bind attribute of the CFSELECT, ColdFusion looks for the cfc in the root directory. Here's an example:
Select State:
Select County:
The AJAX debugger looks for the cfc /school.cfc which obviously doesn't exist. If I move the cfc to a directory under the web root (ie /cfc) it works.
Either I am doing something terribly wrong or these are 2 bugs in CF8.