NCDevCon and my jQuery talk - get the code
NCDevCon in Raleigh this past weekend went well. Dan Wilson, Jim Priest and many volunteers orchestrated a good conference for the second time. I think the fact that it is free to attendees testifies to what can be accomplished with a some hard work. It was really nice to see some new speakers and different topics represented also. A show of hands in a couple of sessions revealed that some participants were not ColdFusion developers, but either designers or developers with other languages.
The fact that sponsors also helped out with some basic costs speaks well of the quality of the conference. Other attendees that I talked to also felt as though it was well worth a weekend of their time to get some good training and networking. Good job and thank you to the Triangle Area CFUG.
I gave my talk on jQuery and AJAX Sunday afternoon. Although I was hoping for a bit more of a hands on type of workshop, it seemed to go well and I had some good feedback. After covering some jQuery basics, I demonstrated about six different use cases for jQuery and its built in AJAX capabilities. The source code, slides, and lesson demonstrations are all available at http://mattjanell.com/NCDevCon/. The "Get the Zip" link at the top includes the source code and slides. The slides are in Open Office format, which one person said he could open in PowerPoint.
Lesson 6 is a partially completed lesson. I told the class participants that their homework before the next NC Dev Con was to finish it out - sure they will :). All the code should be looked at as a starting point or example of how something can be done with jQuery. I owe a thanks to Ray Camden for his timely blog posts on jQuery and AJAX. I used a couple of those as starting points for my lessons.
Feel free to post any questions about the code samples.
CF 9 local scope gotcha
I believe this behavior is as expected, however it can break code that worked in CF 8. Not so much break as in get errors, but you will get the wrong data, which is worse really. Similar issues have been discussed and maybe even raised on the bug tracker, but I didn't see an example quite like this, so I wanted to share.
Basically, when in a function and looping over a query or a list, you may reference a column name or the list index without adding a scope. For example, myQuery has a column named "key."
<cfloop query="arguments.myQuery">
<cfset local.key = key>
</cfloop>
On the first iteration through the loop, the variable local.key does not exist. The column "key" is found in the query, and now local.key equals that value; say it is 1. On the next loop iteration, CF sees that local.key indeed does exist and never looks to the query for the column "key." The scope hierarchy looks in LOCAL before it looks to the query we are looping over. So each subsequent assignment of local.key will equal 1.
There are several fairly simple workarounds: don't use the same variable name for the local scope; scope the right side of the assignment; etc. The point is you will need to watch out for this on legacy code.
See the enclosed file below ("Download Enclosure") for sample code.
Posted 5/20/10 @ 5:19 AM by Matt Williams
Looking for input for NCDevCon workshop
I'll be speaking this weekend at the North Carolina Developer's Conference (NCDevCon) about using jQuery and AJAX in Forms. It will be a hands on workshop so participants can learn by doing. It is geared toward the jQuery beginner. I have a few basic examples of jQuery and AJAX already, but would actually like some ideas from other people. If anyone has something they've seen or wanted to do and wondered how to do that in jQuery, please post it here and I'll see if I can incorporate it.
Since I'm concentrating on forms, I may include a jQuery UI element or two such as the autocomplete, datepicker or tabs. Some of those are not as ajaxy as others, but may be helpful.
Thanks.






