Posts Tagged ColdFusion
CFGrid Problem Solved!
In my previous post My Adventure with CFGrid, I wrote about troubles I was having meeting some minor last minute client requirements. In short, they want a cool table with Ajax features like paging, but they also want links in the table in an Actions column that are not Ajax and take the user to a detail page. Sounds like an odd request for Ajax functionality but what the client wants the client gets.
My initial problem was how to add the links to the Actions column. This was solved with the help of Ray Camden who suggested using the querySetCell() method to add my link data to the query recordset after the query is executed. This worked well enough and my manager was impressed. Something I didn’t pay attention to initially was that the pagesize attribute of cfgrid is ignored when the query attribute is specified. The client definitely wants paging for larger recordsets, so the solution turned out to be using the bind parameter rather than the query attribute.
Having never used databinding before, I jumped right in and quickly found all sorts of little things that normally work, suddenly didn’t. None of my APPLICATION or SESSION variables seemed to be available. Variable not defined was what the error read. By the way, I highly recommend Firebug for debugging Ajax requests. The solution was to either hardcode my variables or add hidden form elements and then pass them in my bind parameter to the CFC. I ended up using both to finally get my awesome looking cfgrid that pages through 10 records at a time and has an Actions column which takes the user to a detail page.

While at CFUnited this I decided to ask around about why my SESSION and APPLICATION variables were coming up undefined when called via the bind parameter. It was explained to me that bind is accessing the CFC directly rather than as a normal ColdFusion request and that is why they were not available. This sounds reasonable to me, but I would like to get some confirmation. So I pose the question to all my fellow CFers out there. Is this really the case with databinding?
Add comment August 14, 2009
My Adventure With CFGrid
I’m using a cfgrid to display some data returned from a query. Not exactly rocket science, but I’ve managed to run into a bit of difficulty meeting a couple of final client requirements. Let me set up the scene here. First I have a form with several different search criteria, which are independent of each other. Depending on which search criterion is selected, a different grid will display. Each grid will has an Action column with links to another page.
Continue Reading Add comment August 11, 2009
Fuseboxing progress – Navigation menu
I’ve been working to convert my church’s old site to Fusebox 4 for ColdFusion in order to get cleaner, more modular code and to make maintenance simpler for parish staff. I started off diagramming a database schema in which the content would be stored. This got me thinking about just how the site would work when finished. I then dropped the core FB4 files into my local webroot and started working.
With a schema in place, I was able to determine the necessary circuit.
- home – this is the default circuit
- sections – drives the navigation menu
- pages – handles page content
- news – drives the news module
- links – drives the links module
- contacts – drives the parish contacts module

Current static navigation menu
I began with the sections circuit and began coding fuseactions. The sections circuit will be the foundation for the navigation menu. Each section corresponds to a link in the navigation. I added a ‘parent’ to facilitate subsections which will appear as flyouts. I then began writing the sections CFC which will access the data. The section CFC contains your basic CRUD methods and one special method to handle subsections. Right now, since there is only test data in the DB, the menu isn’t fully populated with subsections. I should note, that I first considered using the built in ColdFusion 8 <cfmenu> and <cfmenuitem> tags to generate the menu. I actually built the menu, but then decide to go back to the CSS/JavaScript that is used in the current site. All I had to do was invoke the section CFC to display the section data as links in the navigation menu.

Dynamically generated fusebox navigation
Using the Frameworks explorer in CFEclipse, it was really easy to create circuit files and their corresponding fuseactions.
Add comment July 24, 2009
From Contribute to a Custom CMS
I relaunched my parish’s web site 3 years ago using ColdFusion 6 and let staff maintain the site using Contribute. This was no problem at the time as the site was small and had a fairly small audience. Contribute was a quick and easy solution for the 2 parish staff to make updates to the site and it has worked well these 3 years. I was still a novice programmer and had not come to realize the power of CFCs or even any of the many CF frameworks out there.

Current site
The time has come, however, for a serious site overhaul for a few reasons.
- The staff has grown tired of Contribute because it ties them to a single machine for updating the site.
- Site usage has increased tremendously
- The site has become cluttered with old, outdated content that in most cases is no longer needed
- Our host was not very reliable.
I first focused on open source blog and CMS software for our solution. The CMS packages generally fit into two categories:
- Far too complicated
- Small feature set even for our fairly basic needs
After lots of trial and error, I decided to build my own custom CMS. I use Fusebox 4 in my daily work, so this was a logical choice. The front-end code can be organized and easily maintainable. Content will be stored in a database, likely MySQL or SQL Server, and an administrative module will be used for content maintenance. I’m going to use Flex 3 to build the admin module, which will allow staff to add, edit, and delete content from any machine with Internet access.
I’ll periodically update with my progress.
Add comment July 24, 2009
Content Management with ByteSpring
I am currently testing Jason Sheedy’s ByteSpring CMS, a ColdFusion based basic CMS for use in my church’s web site. Right out of the box, I’m impressed.
Continue Reading Add comment July 31, 2008