I found myself in need of a function to get the ordinal suffix for any number. Naturally, I googled and found some examples out there but they all seemed to have many lines of code and I felt an uncontrollable urge to see if I could condense it down to one line. I jumped on over to trycf.com and fiddled around for a bit and I came up with this:


Normally when I want to force traffic to use SSL on a ColdFusion application, I will set up the redirect in the web server (Apache/IIS) configuration. However, there are occasions where I have not had access to modify the web servers configuration. In these cases I will place this snippet at the beginning of the onRequest() function of Application.cfc:


Leon asked:

"I wondered if you know of a way to control the scroll position of the contents in a cfwindow? Do you know if there's some ext api function or property that can be used sort of like the JS scrollIntoView() type function, but applies to the ext window?"

The solution to the problem can be seen in the cfWindowScrollIntoView() function I created below


I hear a lot of OOP fans say that OOP makes large applications "easier to maintain", and the question always comes to mind "Easier for whom?". If I ask "Who will be maintaining my application?", the answer is "ColdFusion developers", and if I ask "Which programming paradigm are ColdFusion developers generally more comfortable with?", I would have to say the answer is "Procedural". Here in the Orange County/Los Angeles area, it's hard enough to find a decent CF developer without limiting my search to the small amount of people that claim to be OO programmers (and some of those aren't even really OO programmers, they just need a job and will say anything). Not to mention that the CF Developers that really do know OOP are often more expensive than their procedural counterparts.

I am not an OOP guru, so my opinion may not be firmly planted in reality, but I don't think the size of the application really matters when it comes to deciding weather to develop it in pure OO code or to develop it using procedural code and maybe sprinkling in some OO concepts where it makes sense.


Willis asked:

"Do you know how to disable or turn off the right mouse click menu for cfgrid?"

This is actually pretty easy, all you need to do is set up a listener on the contextmenu event and have the listener cancel the event. Here is the code (click here to try it):


At last nights OCCFUG meeting, one of the members asked what is the best way to access the data from nodes in an XML document that have xmlns namespace prefixes. I touched on this topic briefly in the comments of my post about reading XML documents, but I thought I would expound upon it a little more as there doesn't seem to be a lot of solid explanations out there on how to do this in ColdFusion. In a nutshell, the answer is to use XMLSearch() with an xPath expression that utilizes the namespace-uri() function.


As those of you who were at last night's meeting know, I am now the co-manager of OCCFUG. I am pretty excited about this opportunity to help out with some of the administrative things that go into keeping the group going. I love going to the meetings and hope the group continues to grow.

Several people asked for the slides from my presentation last night, so I have attached them to this post. (click the download link below)

At the Orange County ColdFusion Users Group (www.occfug.org) meeting tonight, I will be presenting an overview on all the AJAX related features in ColdFusion 8. Then I will be going into detail on some of my favorite features and offer some tips on how to dig into the underlying Ext objects to find the solutions you need when your application requires more customized functionality than the default behaviors that were implemented in CF8.

So if you're in the Orange County area, come to Traveland USA tonight at 6:30 pm and join us.

A while back I blogged about a div layer positioning glitch that occurs in IE when you position a cfinput datefield above a cflayout or cfdiv generated div layer. This problem seems to be cause by the fact that in IE, a relative positioned element influences the stacking order of it's child-elements, which violates the CSS specification, but who really needs standards anyways right?

Well, I figured out a way to workaround it, and it's really stupid that I didn't think of it before. I kept trying (unsuccessfully) to write a JavaScript function that would find the layers and reposition them after the page loaded, when finally a light bulb went on in my head, and I came up with a much simpler solution.


In a comment on a previous post I wrote about Enhancing CFWindow with JavaScript, Ebenezer asked the question:

"CFwindows is quite nice, but i need it to behave in a particular way. I want to remove the frame and the (x) close button. I want to use cfwindow to just "display the bigger size of an image on mouseover and close on mouse out. Anyone with an idea."

Below is an example of how to remove the toolbar and borders from the cfwindow and display the large image when you rollover the thumbnail.


More Entries