Review of a very good beginner ColdFusion Book..
ColdFusionWith the wealth of information available on the Internet on ColdFusion programming, I never thought I would buy a book on it.
I was doing a trial membership of Safari Books Online and found the book.Macromedia ColdFusion MX 7Web Application Construction Kit. I added it to my book shelf expecting to find just another programming book written for seasoned developers. I was wrong.
For the beginner this is a great book. You can find pretty much all the topics in this book on the Internet, but not all in one place, and not layed out in such an easy to understand format. The authors did a fantasic job of making it a very readable book. They take there time explaining topics, then show you the code, then explain it, line by line and how it all interacts together.
If your a beginner/newbie with ColdFusion, make sure and check this book out. It now has a permanent location next to my keyboard. We'll worth the $50.
The ColdFusion Community
ColdFusionAs i've been working thru the issues trying to get BlueDragon working on my Ubuntu box, I'm again reminded of the awesome community build by all you ColdFusion Developers. You guys are truely great.
Adam Howitt took 2 hours out of his Sunday afternoon to help me on the issues with BD and Ubuntu. This guy is a complete stranger, saw my plea's for help on the BlueDragon list, and very diligently has been working with me to get it running. Here's a guy that purely out of the kindness of his heart took hours of his time out to help a almost clueless newbie like me. Now that's community. That's the ColdFusion community that is making me love this language.
Please take the time to check out Adam's pages. http://www.webdevref.com/blog and http://www.walkjogrun.net.
Also, people like Dave Shuck and Aaron Lynch are always offing to help me out. The generosity of people like Dave and Aaron speaks volumes about the ColdFusion community they represent. Thank you guys!
Last but definitely not least I also want to thank Mike Hanson. I met Mike thru my church a couple of years ago. He has spent so much of his time teaching me and mentoring me on ColdFusion and other related technologies. I really am so grateful for his time and patience and wouldn't be nearly as far along as I am if it weren't for him. Thank you Mike,
If anyone actually reads this, I ask that you please check out the web pages of these 4 guys and support them in any way you can. They deserve it!
So, before I start suggesting group hugs here or at the next CFUG Meeting, I'll close this thing.
Later,
Mark
Easy Page navigation using CFSwitch and URL Variables
ColdFusionIn some of my apps I've been writing, using CFSwitch is a really nifty way to do conditional processing on my pages, allowing me to get away from an endless number of CFIF's. Especially when using CFSwitch tags for controlling navigation on my application.
I know this isn't earth moving news for you seasoned cf developers out there, but I find cfswitch to be a very interesting and powerful tab.
A little back ground first. I'm slowly writing a app that will allow users to do reviews on service providers of a certain industry. I had a need for a page that has the service providers contact information, at the top, but has a link or tabs with links to be able to edit the service providers information, add notes, add a review, or view reviews. I didn't want to display all the forms down the page as I wanted it all on one screen so the user didn't have to scroll all the way to the bottom to add a note. They could click on a link, that would leave the service provider contact information at the top of the page, but change the form at the bottom to the appropriate form to add a note or what ever link or tab they clicked on.
As your reading this code, of course there are some assumption you will need to make. Like, this page is the resulting page from a query or a drill down page from a query. The initial url would be "index.cfm?=serviceproviderID=#url.IDFromDatabase#"
So, here's the code:
It seems to work pretty well. Being new to this whole programming thing it was pretty neat to figure this out and not have to depend on someone elses snippet to get it working. So I figured I'd post it in case some other newbie need something like this on there page. This is the first time I've posted any code like this. I took my working code and "sanitized it" for this entry, so if you see an issue with it please let me know.
Later,
Mark
Database Woes... No More!
ColdFusionSorry for the delay in getting this updated. I haven't had a lot of time lately.
My last post was about my confusion with what looked to be a very easy topic. Writing one form, or better yet two forms on a page to multiple tables within a Access Database. I was a bit confused, but with the help of a friend who is experienced with this stuff, and looking over code snippets, I got it figured out.
Here's what I was trying to do. I've got a form where you would add a customer. That form also has a notes section. Another form on the site will allow you to edit the customer and add notes to it. So for any given customer, I needed a way to have multiple notes attached and displayed. So, here's what I did. In my db, MS Access Db in this case, I created another table call custnotes, with 3 fields, the notesID (primary key), notes, and the customerID. I then created a relationship between custmerID field in my customer table, and the customerID field within my custnotes table. That was the easy part, or so it seemed.
So, my next goal was to get the form to write to the multiple tables within the database. First major hurddle I ran up against was, "How do I tell the database which record this note belongs to?" or better yet, "how do I get the form to "link " them as it's being inserted into the database" Well, based on the simple recommendation from my friend Mike, here's what I did.
The form page is just a typical form page, nothing special about it, execpt that I made the notes field a seperate form. Seperate from all the contact information, but to the user it looks like there is only one form as there is only 1 submit button. Then, on my action page for that form, I input all the contact information using cfInsert, and here's where the real fun starts.
After all the contact information is stored, I run a cfQuery on the data that was just entered to get the customerID. Just a simple query ran to find the clientID that was just created by searching for the name and zipcode of the customer that was just entered. Once I got that customerID I was home free. Right? Wrong....LOL
I was reading about cfInsert, and found that it can only be used to input form data. Since I just got the customerID from a query, it's not form data, so how do I put it into the notes table with the note? hmmm. So I got to looking around and found that cfquery can insert data as well as cfinsert. Remember, i'm a newbie, so don't laugh. So, I wrote a cfquery to insert the notes and the customerID into the custnotes table.
Much to my surprise, it worked like a charm. I about fell out of my chair. I start cheering for myself. My wife thought I lost my mind.
Anyway. For my edit customer screen, it works on the same principal, but I get the customerID from the URL Variable passed when I drill down into the customer i want to edit, and on the edit page I've split out my notes into a seperate form, incase that's all the user wants to edit. I've still got a fair amount of work to do to secure it all, but it seems to work fine.
I haven't had time to clean the code up to put on here, but if you want it email me and let me know.
One note to all this. Upon further research, and a hint from a friend, I could use CFinsert for this, by storing the clientid as a form variable using a cfset. something like <cfset form.customerid="#customerid#"> I haven't tried it , but it sounds like it would work.
I'm probably missing something here, and will update this as soon as it hits me.
Thanks for reading and looking forward to you all's imput,
Mark
Database Woes
ColdFusion
So, of course the main purpose of writing any web app as I see is is to be able to write, edit and retreive data from databases. So, not being much of a database expert, or really even that familiar with Relation databases. This has proven to be an interesting exercise in patience for me!
Here's the problem. Well, problem to me, probably baby food stuff for most of you. I've got a database with a couple of tables. One table is for accounts, the other is for notes. The notes are supposed to be attached to the account based on the accountid. Well, at least that the field I mapped it to in the MS Access. Thinking is, I've got one account, but multiple notes for each account, and I want to be able to view the account with all the notes attached to that account. Sounds easy enough, don't it. Yea, right.... LOL. Believe it or not it is fun trying to figure this stuff out. Any way. I have yet to figure out how to make the notes attach to the account.
Here's my thinking. When the account is created, you get a chance to enter the intial note for the account. I can get the account info saved in the account table, and I can get the notes to save in the notes table, but I haven't quite figured out how to link the two. I look in the notes table in the db and I see a blank area where the accountid should be even though I though I told it to input the account ID in the table in the code???
Of course I'm leaving a lot of pertinate information out here but I'm still working on this and as soon as I get if figured out I'll post the code and an explanation.
So, off to bed. I've got to be to work at 7am in the morning. I'll update this as soon as I get it done.
Later,
Mark





Loading....