Cheers Barney, that's interesting stuff.
I pretty much see what's going on, although to me it more suggests that a <cfflush> should not be allowed INSIDE the custom tag file (it's not), but should be fine (and do what it's told) in the code on the calling page that happens to be within the custom tags, which should be a reference to flush whatever's in the buffer for that page context. But, anyway, yeah: it's predictable that CF was designed to do it the way it does.
I've just run a similar test with a CFC function (which allows <cfflush>). It seems that despite each of the calling code, CFC-pseudo-constructor and function code all have different page contexts (my test of this is to do this: <cfdump var="#getPageContext().toString()#">; revealing different pointers for each), they all work with the SAME output buffer.
Sorry to drag on... just trying to understand wha's going on and why.
Just if you're interested, here's that code:
<!--- caller.cfm --->
<cfset request.buffer = structNew()>
top of caller.cfm<br />
<cfset request.buffer["1. Before createObject"] = getPageContext().getOut().getString()>
<cfset o = createObject("component", "c")>
after object creation<br />
<cfset o.f()>
after f()<br />
<cfset request.buffer["4. after f()"] = getPageContext().getOut().getString()>
before dump<br />
<cfoutput>
<table border="1">
<cfloop collection="#request.buffer#" item="entry">
<tr><td>#entry#</td><td>#htmlEditFormat(request.buffer[entry])#</td></tr>
</cfloop>
</table>
</cfoutput>
after dump<br />
<cfoutput>#getPageContext().toString()#</cfoutput><br />
<!--- c.cfc --->
<cfcomponent>
top of cfc<br />
<cfset request.buffer["2. CFC"] = getPageContext().getOut().getString()>
<cfoutput>#getPageContext().toString()#</cfoutput><br />
<cffunction name="f">
top of function<br />
<cfset request.buffer["3. f()"] = getPageContext().getOut().getString()>
<cfoutput>#getPageContext().toString()#</cfoutput><br />
</cffunction>
</cfcomponent>
--
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]