Barney, can you please explain something to me...
Here's some sample code:
<!--- caller.cfm --->
start<br />
<cfset stDebug = structNew()>
<cfset stDebug["1. bufferBeforeTag"] = getPageContext().getOut().getString()>
<cf_tag>
text before capturing buffer<br />
<cfset stDebug["2. bufferInsideTag"] = getPageContext().getOut().getString()>
text after capturing buffer<br />
</cf_tag>
text outside closing tag<br />
<cfset stDebug["3. bufferAfterTag"] = getPageContext().getOut().getString()>
<cfdump var="#stDebug#">
<!--- tag.cfm --->
<cfif thisTag.ExecutionMode eq "end">
<cfset thisTag.generatedContent = ucase(thisTag.generatedContent)>
</cfif>
Now... this is a bit curious. It kind of seems like CF is putting the content within the custom tags into the buffer as soon as it encounters it, but when it gets to the closing tag, finds its got some work to do, says "ooh... heck... better grab that stuff out of the buffer again... um... uppercase it.... cool, that was easy... back in the buffer you go. Hopefully no-one will notice I put you in the before I'd finished processing it".
Is that's what's happening? Surely not. There's some vagary there that I'm not seeing.
Shouldn't the custom tag processor not be putting anything into the buffer until the closing tag is hit? I mean... it *knows* there's a closing tag "hasEndTag" or whatever it is, so why not wait for it?
This whole "there's no way of knowing" is a problem CF seems to make for itself by dipping in and out of the buffer!
To me this <cfflush> thing is making a complex situation out of a simple one. A buffer is a binary system: stuff is either in it, or not in it. That's it. <cfflush> should simply say "right, you lot... off to the browser". If it's in the buffer... it's gone. If it's not... well, it's not relevant. CF seems to be creating some situation of "yeah, but this stuff is *almost* in the buffer (in fact, if you look closely, it *is* in the buffer) and I reckon they're going to want this stuff, so you better wait for a tick...".
Whereas I might be inclined to not be second-guessing anything, and if I got told "send the buffer now", I'd simply... send the buffer... now. And not put anything in said buffer until it's actually ready to go.
Can you pls clarify?
--
Adam
This email contains confidential information. If you are not the intended recipient of this email, please notify Straker Interactive and delete the email. You are not entitled to use it in any way.
---------------------------------------------------------- You are subscribed to cfcdev. To unsubscribe, send an email to [email protected] with the words 'unsubscribe cfcdev' as the subject of the email. CFCDev is run by CFCZone (www.cfczone.org) and supported by CFXHosting (www.cfxhosting.com). An archive of the CFCDev list is available at www.mail-archive.com/[email protected]