| By Bruce Van Horn | Article Rating: |
|
| December 26, 2000 12:00 AM EST | Reads: |
7,555 |
Well, the new millennium is finally here (sorry for those of you who thought it started last year) and with it comes many unanswered and some unanswerable questions.
Fortunately for you CF developers out there, your CF questions don't have to fall into the category of unanswerable.... Send them in, and we'll get them answered for you. Here are some recent questions to kick off the new year:
Q:I need to do a three-layer grouping in a report to properly display my information. In MS Access this is no problem; you just use the grouping in the report and work your way through as many levels as you need (to a point). But CF seems to be limited to only two layers (see code that follows). How can I get three or even more layers to display?
<CFOUTPUT query="queryname" group="query_column">
#toplayer#
<CFOUTPUT>
#nextlayer#
<CFOUTPUT>
</CFOUTPUT>
A:Actually, you can go as deep as you want; you just need to keep specifying the GROUP attribute for each level until the last. Remember to sort your query (using the ORDER BY clause in your SQL) by the columns in which you plan to group the data, as shown here:
<CFQUERY NAME="queryname" DATASOURCE="datasourcename">
SELECT column1, column2, column3
FROM tablename
ORDER BY column1, column2, column2
</CFQUERY><CFOUTPUT query="queryname" group=" column1">
#toplayer#
<CFOUTPUT GROUP=" column2>
#nextlayer#
<CFOUTPUT GROUP=" column3">
#nextlayer#
<CFOUTPUT>
#nextlayer#
</CFOUTPUT>
</CFOUTPUT>
<CFOUTPUT>
</CFOUTPUT>
Q:I just upgraded my version of MS Internet Explorer from 5.01 to 5.5, and now CF Studio won't show me any of my page changes unless I click the refresh button in Studio's browser. This is very annoying. Is there any way to get Studio to stop this behavior?
A:Yes! The problem actually has nothing to do with Studio. The problem lies within the way IE 5.5 caches pages. To fix this, open up IE and go to the "Tools" menu, then choose "Internet Op-tions." In the "Temporary Internet files" section, click on the "Settings" button, then tell IE to "Check for newer versions of stored pages" on "Every visit to the page." This will fix the problem of browsing in Studio, because IE will now detect that the page has been modified. Remember that the internal browser for Studio is actually just Internet Explorer.
Q:In my cfm page, I have a condition where I need to do a CFLOCATION to a page in a different frame. You can't specify the "target" attribute. Is there a way to do this?
A:No, not using CFLOCATION. The problem here is that ColdFusion is executed entirely on the server with no knowledge of or ability to control things that happen in a browser. CFLOCATION is a server-side redirect. What you need to do is a client-side redirect, which you can accomplish by using a simple JavaScript statement. Where you would have placed the CFLOCATION tag, put in this JavaScript: <SCRIPT> parent.framenamehere. location.href='newpage.cfm'</ SCRIPT> (replace "framenamehere" with the actual name of your frame).
Q:I seem to remember you showed us in class how to display alternating row colors in a table that's created by <CFOUTPUT>, but I don't remember the code. How can I do this?
A:Here's one easy way:
<CFOUTPUT QUERY="myQuery">
<TR <CFIF myQuery.CurrentRow MOD 2>BGCOLOR="Yellow"</CFIF>>
<TD>Some data here</TD>
</TR>
</CFOUTPUT>
Please send questions about ColdFusion (CFML, CF Server, or CF Studio) to AskCFDJ@sys-con.com.
Published December 26, 2000 Reads 7,555
Copyright © 2000 SYS-CON Media, Inc. — All Rights Reserved.
Syndicated stories and blog feeds, all rights reserved by the author.
More Stories By Bruce Van Horn
Bruce Van Horn is president of Netsite Dynamics, LLC, a certified ColdFusion developer/instructor, and a member of the CFDJ International Advisory Board.
- Oracle To Keynote Cloud Computing Expo
- Contrary Opinion: Why Silverlight is Good for Adobe
- Analytics for Adobe Air Applications
- Adobe’s Aiming ColdFusion at Multiple Clouds
- Eval JavaScript in a Global Context
- Fig Leaf Software to Exhibit at Government IT Conference & Expo
- Is Microsoft as Free as Open Source?
- Cloud Computing Journal: Adobe to Deliver ColdFusion in the Cloud
- The Planet Named “Bronze Sponsor” of Cloud Computing Expo
- Adobe Reader Sued
- AJAX World RIA Conference & Expo Kicks Off in New York City
- Adobe Enters Cloud Computing with LiveCycle
- Oracle To Keynote Cloud Computing Expo
- Social Media Terrorists
- Adobe Flash Media Server on iPhone
- Contrary Opinion: Why Silverlight is Good for Adobe
- Adobe Flash Based GetJar Surpasses a Half Billion Downloads
- Adobe ColdFusion 9 and ColdFusion Builder Public Betas Now Available
- Adobe Tries Commercializing Its Online Software
- Adobe Open Sources Flash Initiatives
- The Next Programming Models, RIAs and Composite Applications
- Where Are RIA Technologies Headed in 2008?
- Constructing an Application with Flash Forms from the Ground Up
- AJAX World RIA Conference & Expo Kicks Off in New York City
- CFEclipse: The Developer's IDE, Eclipse For ColdFusion
- Personal Branding Checklist
- Adobe Flex 2: Advanced DataGrid
- Has the Technology Bounceback Begun?
- Building a Zip Code Proximity Search with ColdFusion
- i-Technology Viewpoint: We Need Not More Frameworks, But Better Programmers




































