Build Master/Detail page in ColdFusion

Build a dynamic Master/Detail Page in ColdFusion. Tutorial assumes no prior knowledge of ColdFusion. Happy programming! UDnewbie.com


ColdFusion Master/Detail Pages

Page 1, Page 2, Page 3

You should now see a repeat region of your Database column. You could stack them on top of each other by adding a line break <br> after the variable. We need to now link these cateogries to a Detail Page.

1.
Simply surround the variable with a normal html href tag linking to a Details.cfm page:

<cfoutput query="rsMaster">

<a href="Details.cfm">
#rsMaster.CatTitle#</a>

</cfoutput>

2.
lets work on the queryString now, we want to pass the CatID of each Category:

<a href="Details.cfm?CatID=#rsMaster.CatID#">#rsMaster.CatTitle# </a>

Whats going on?
Do you see what happened. We added the infamous ? which begins the queryString and we pass the text CatID being equal to a #rsMaster.CatID# variable which comes from the database just like our #rsMaster.CatTitle# does. Bear in mind
#rsMaster.CatID# will be the only thing displaying from our database in the queryString.
In ASP, this would be:
<a href="Details.asp?CatID=<%=rsMaster.Fields.Item("CatID").Value%>"><%=rsMaster.Fields.Item("CatTitle").Value%></a>

3. Check your page in the browser again and place your mouse over the Links and look at the Status Bar in the Web Browser.

errrm ... we are done with the master.cfm Page. Lets go to the Details.cfm page. Now that you are catching on lets finish it in a snap. If you can try to make the Recordset of the Details page on your own. And if you are really snappy, try and complete the Details.cfm page on your own. It will be fun. When I learned the basics of ColdFusion Recordsets and Variable scope, i made my own Login application in no time o) ColdFusion is that easy. fyi, you can retrieve the CatID variable from the queryString with this #URL.CatID#, go for it!

Go to Page 3

Omar Elbaga

Starting out as a fine artist, Omar Elbaga gradually moved to computer graphic arts. He was particularly amazed by the power of the World Wide Web, so he embarked upon building small-scale sites for fun utilizing HTML and his Art background. Falling in love with designing web pages and its potential, he began a career in web design. Omar has since been in the web development field for several years. With his head in computer books nearly 24 hours a day, Omar moved on to enhance his skills from web design to web programming.

Most of his work involves building database-driven web sites for small companies. Omar is currently running a popular Dreamweaver MX resource site named dmxfire.com

See All Postings From Omar Elbaga >>

Comments

Be the first to write a comment

You must me logged in to write a comment.