I have never used ColdFusion custom tags to wrap around the content of a page as in this example:
<!--- Wrap page output. ---> <page:template> <h1> Welcome to this page </h1> <p> Doesn't she rock!?! </p> </page:template>
For my Team Nylon project, I thought I would give it a go; see what all the hubbub is about. Things started out nicely but then I hit a HUGE bump. I was looping over a large collection of data output tables and putting a CFFlush tag after each table to flush it to the browser when I got this error:
Unable to perform CFFLUSH.
You have called CFFLUSH in an invalid location, such as inside a CFQUERY or between a CFML custom tag start and end tag.
YIKES! I forgot you cannot perform a CFFlush inside a custom tag. Well, so much for that idea. Not being able to perform a CFFlush violates one of my two laws on proper page design and rendering. Looks like it's back to just including the header and footer templates.
I wonder, if you cannot perform a CFFlush during a custom tag's execution, does ColdFusion every flush content to the browser when processing a custom tag? If this is the case, then that means that the use of a ColdFusion custom tag page wrapper delays content flushing until the entire page has been processed. That get's my panties in a bunch!
Want to use code from this post? Check out the license.