Friday, March 19, 2010    
Home My Books Blog ColdFusion About Me Back    

Calendar
<< Feb 2007 >>
S M T W T F S
        1 2 3
4 5 6 7 8 9 10
11 12 13 14 15 16 17
18 19 20 21 22 23 24
25 26 27 28      

Search

Categories
 • Acrobat (3) [RSS]
 • Adobe (90) [RSS]
 • AdobeMAX06 (45) [RSS]
 • AdobeMAX07 (59) [RSS]
 • AdobeMAX08 (66) [RSS]
 • AdobeMAX09 (39) [RSS]
 • AdobeMAX10 (1) [RSS]
 • AIR (219) [RSS]
 • Appearances (191) [RSS]
 • Books (72) [RSS]
 • CFEclipse (15) [RSS]
 • ColdFusion (1381) [RSS]
 • Data Services (34) [RSS]
 • Fish Tank (5) [RSS]
 • Flash (197) [RSS]
 • Flex (498) [RSS]
 • Home Automation (5) [RSS]
 • Jobs (116) [RSS]
 • JRun (14) [RSS]
 • Labs (43) [RSS]
 • LiveCycle (34) [RSS]
 • MAX (232) [RSS]
 • Mobile (120) [RSS]
 • Regular Expressions (17) [RSS]
 • RIA (21) [RSS]
 • SQL (40) [RSS]
 • Stuff (536) [RSS]
 • Tips (CF Studio) (80) [RSS]
 • Tips (CF) (795) [RSS]
 • Tips (Dreamweaver) (91) [RSS]
 • Tips (Flex Builder) (2) [RSS]
 • Using CF (162) [RSS]

Other BLOGs
 • Charlie Arehart
 • Lee Brimelow
 • Ray Camden
 • Christophe Coenraets
 • Sean Corfield
 • Mihai Corlan
 • Cornel Creanga
 • Mark Doherty
 • John Dowdell
 • Danny Dura
 • Enrique Duvos
 • Steven Erat
 • Kevin Hoyt
 • Serge Jespers
 • Adam Lehman
 • Duane Nickull
 • Miti Pricope
 • Andrew Shorten
 • Ryan Stewart
 • James Ward
 • Greg Wilson
 • Full As A Goog

RSS Feeds
 • Feed
 • Subscribe

Join my mailing list and find out about new books and other topics of interest.

Thoughts, ideas, tips, musings, and pontifications (not necessarily in that order) by Ben Forta ...
NOTE: This is my personal blog, and the opinions and statements voiced here are my own.

Viewing By Day : February 12, 2007 / Main
February 12, 2007

ColdFusion IM Gateways Power IMified

IMified is an IM based productivity tool that works across all the major networks and offers access to a number of popular web applications, as well as tools like notes, reminders, and to-do's all in your favorite IM client. The service just launched on February 5th, and has been adding lots and lots of users, and getting lots of positive feedback.

The service is powered by ColdFusion MX7, and relies on the built in event gateways to provide the IM integration (the public site is also running ColdFusion) and ColdFusion and the gateways have handled the high load they've been under extremely well. In the words of partners Anthony Webb and Dave Hoff, "we've brought to market a really slick and useful service and couldn't have done it, or at least as fast, without CF."


CFOUTPUT Grouping Gotcha

CFOUTPUT makes grouping nested result sets really easy, just use the GROUP attribute to specify the column to group by, and then nest CFOUTPUT tags as needed (and multiple levels of grouping are supported, too). This example will display dept each time that value changes, and then create an unordered list of users for each:

<cfoutput query="users" group="dept">
    <h3>#dept#</h3>
    <ul>
        <cfoutput>
            <li>#username#</li>
        </cfoutput>
    </ul>
</cfoutput>

CFOUTPUT also makes displaying partial result sets really easy, just use STARTROW to specify the row to start from, and MAXROWS to specify the maximum number of rows to display. Here's a simple example:

<cfoutput query="users" startrow="1" maxrows="25">
    <li>#username#</li>
</cfoutput>

Now, what would happen if you combined GROUP with STARTROW and MAXROWS, like this?

<cfoutput query="users" group="dept" startrow="1" maxrows="25">
    <h3>#dept#</h3>
    <ul>
        <cfoutput>
            <li>#username#</li>
        </cfoutput>
    </ul>
</cfoutput>

You'd probably expect STARTROW and MAXROWS to apply to the entire result set, so that if you had 5 departments with 10 users in each (50 rows total) the first 25 rows would be displayed (all users in the first 2 departments and 5 of the users in the third). But, nope, it does not work that way. STARTROW and MAXROWS do their calculations based on how many times their CFOUTPUT is invoked, and so when used with GROUP, STARTROW and MAXROWS apply to the outer group. In this example, the first 25 groups would be included, and thus all 50 users.

I am not sure that I actually agree with this behavior, but that's the way it is. In practice, this means that if you do need to use GROUP together with STARTROW and MAXROWS, then you'll probably want to copy the subset of query data to be used to another query first, and pass that second subset query to CFOUTPUT.

  © Copyright 1997-2009 Ben Forta, All Rights Reserved