Monthly Archives: October 2008

The ACME Guide 3rd Edition

Recently, I added to my “Preferred Blogs” list our colleague Stephen Collins from Australia.
I had the pleasure to chat with him over Skype. He is the founder of “acidlabs“, a social media, networking and knowledge economy company and, according to him, there is no more time for ColdFusion programming.
But he has left us a legacy work on his book The ACME Guide, where he creates an environment and documents all the installation steps for CF, Eclipse, servers, etc… This 3rd edition is compliant with ColdFusion 7, still very useful. I recommend the reading of this guide.
You may download the PDF version here.

Query Sorted Results in HTML Table

Nowadays we have ways of sorting the display results from a query without resubmitting the page by using Ajax. Long time ago I wrote a custom tag with the help of my coworker Jason Sheppard to do the same by submitting the page with the new sort field information.

So, for those who do not want Ajax or do not know how to do it, I converted my custom tag into a component and I’m making it available here. Feel free to implement more features, just don’t forget to send me a copy.

You may download the code here.

Read More…

Session Timeout Notice Using Javascript

Sometimes in an Intranet you need to notify the client that his session is about to expire and let him to decide if he will renew his session or let it die. That can be done either on server or client side.

We will discuss here the client-side way using Javascript and/or Ajax to refresh the session.
The script offers two ways of refreshing the session, one by just reloading the page and other by calling an Ajax function.

If your template is a form, you will want definitively to use Ajax, or you would lose all the fields already filled in. If you are in a simple display page, refreshing that page will not cause any problems.

So, I used a sample my friend Pedro Claudio posted on the CF-Brasil mailing group, and modified it to be used in CF templates with CFAJAX components (not the CF8 tag). I also modified it to use the Javascript function “setInterval()” instead of the “settimeout()” which will continue counting the time after every renewal.

I created this test environment that you may download here.

Read More…

Moving Options to Other Select Object

My friend Flavio asked me for a code to select some options from a select box and populate other that will be submitted with the form as the “chosen” options. I know that there are many forms to do that and there are on the web several tutorials using Javascript and extensions as jQuery, etc. 

I wrote a simple javascript with ideas from what I have seen on the web and it came out working good. So the credits are not all mine.
Download the code here

Read More…

New Chinese iPhoneys

Network World magazine published today an article about the Chinese iPhone look-alike or even clones. They have many models and are unlocked. Some do not work in the U.S. but the majority of them work here with any provider. Here is the article “Top 16 Chinese iPhoneys“. You may find in the article the place to buy them online.

iPhoney 1iPhoney 2iPhoney 3iPhoney 4

CFLOCATION Does Not Work After CFFLUSH

I’m writing a new import module for our real estate system where I have to read several XML files and process many photos, resizing them for the web and updating the database. Due to the amount of picture files to process, I was getting CF tag timeouts, sometimes the image tag, sometimes other tags. So instead of doing everything in one processs looping through all XML files, I decided to pick the first one up and process it, and at the end I put a CFLOCATION to call itself to process the next file until there are no file to process. 

The template worked well, did everything it had to do, but stopped at the end without calling itself to process the next file, and did not throw any error.

It took me a long time troubleshooting it, then I found an article by Peter Freitag about the tag CFLOCATION performing a client redirection where he mentioned another option of using CFHEADER to redirect:<cfheader statuscode="301" statustext="Moved Permanently">
<cfheader name="Location" value="http://www.website.com/">

That didn’t work either, but at least threw an error saying something about the page had been flushed.

Well, looking at my code I could see the several <cfflush> tags I had to track the process in real time. As soon as I took them out of the code, the template worked perfectly.

So I wrote this post just to admit my stupidity and to alert our colleagues not to use the combination CFFLUSH and CFLOCATION.