CounterMarch Systems

proud to be geeks


We used to blog more before twitter came along.

Fun with CFAJAX

Had a little app that needed to be put together. It's essentially a survey that the student body will be accessing once they get back from Spring Break (*sigh*). See. there are about 420 "activities" that students can participate in at Lehigh. These groups are terrible at reporting their membership information. so we're going to try out self-reporting at the individual level.

Needless to say. the prizes for participating are pretty cool - I think there's a 60GB iPod up for grabs!

Anyway. long story short because it's pushing 3:30AM. putting a 400+ element select box on the page is just a terrible idea. The activities themselves are poorly classified (tell me why we had "undergraduate" and "student" categories in Banner?). so doing any easy breakdown is darn near impossible.

Not one to miss an opportunity to blend in some old techniques with new ones. I decided to throw Verity at the problem. Bam. 6 seconds to build the index. all searches are about 100ms. I took it up a notch and added a "tags" column to the activity table and kicked in a few extra key terms for most of the activities (so you could search for "music" and get back choir. band. etc.). Rebuilt the index and i'm still getting results back blisteringly fast. Last time I played with verity was cf5. so i'm impressed with not only the tool but the speed with which it works.

So how do we search this? Ajax! Wired up a single search field that sends a request via ajax to the back end. runs the tag. spits back the result set into a div right under the search box. Click to add to your profile. want to remove one? Click to remove. That simple. All Ajax talking to a CF/Mach-ii back end.

Many thanks to my colleague Matt for doing the serious grunt work on learning the intricacies of Ajax before I picked it up. He saved me a LOT of time with encoding/decoding issues and any cross-browser issues that would tend to arise. I now understand why getting this stuff working is cause for celebration - it's so damn cool to make these apps work in the browser!

Comments

About the blog

7 years of outstanding software development

CounterMarch Systems is a professional consulting firm specializing in Adobe technologies with a special focus on higher education.

2771 Red Oak Circle
Bethlehem, Pennsylvania 18017
610.280.3455
Contact Us