|
Mailing Lists
|
Home /
Groups /
ColdFusion Talk (CF-Talk)
CFCONTENT does not reset
Hi,Claude_Schnéegans 08/06/12 05:52 P > I came across a problem with CFCONTENT. Even if the attribute RESET="yes" is used, the content which was previously set by <cfhtmlhead is not reset.Dave Watts 08/06/12 09:47 P >>Once you use anyClaude_Schnéegans 08/06/12 10:27 P >>Once you use anyClaude_Schnéegans 08/06/12 10:34 P Hi, I came across a problem with CFCONTENT. Even if the attribute RESET="yes" is used, the content which was previously set by <cfhtmlhead is not reset. Ex 1: <cfhtmlhead text = 'This is in the head section'> <cfcontent type="text/html; charset=ISO-8859-1" RESET="yes"> This shouldn't have the head section. </cfcontent> Ex 2: <head>This is in the head section</head> <cfcontent type="text/html; charset=ISO-8859-1" RESET="yes"> This shouldn't have the head section. </cfcontent> In Ex 1, the text "This is in the head section" still appears in the page. In the ex 2 it does not. Is this a bug, or an undocumented feature ? Anyway, is there some way I could clear what was previously set with <cfhtmlhead ? Thanks. ----- Excess quoted text cut - see Original Post for more ----- I believe this is the expected behavior. Once you use any functionality that explicitly writes part of the response (CFHTMLHEAD, CFHEADER, etc) you can't use functionality that lets you manipulate the storage buffer (CFCONTENT, CFFLUSH). Dave Watts, CTO, Fig Leaf Software http://www.figleaf.com/ http://training.figleaf.com/ Fig Leaf Software is a Veteran-Owned Small Business (VOSB) on GSA Schedule, and provides the highest caliber vendor-authorized instruction at our training centers, online, or onsite. >>Once you use any functionality that explicitly writes part of the response (CFHTMLHEAD, CFHEADER, etc) you can't use functionality that lets you manipulate the storage buffer (CFCONTENT, CFFLUSH). Not so sure about this. I've noticed that the effect of CFHTMLHEAD is to find the <HEAD>...</HEAD> pair in the output at the end of the output creation and simply insert the text right before the </HEAD> tag. If no <HEAD> tag is found, the text will be added at the beging of the output buffer. You may use <HEAD>...</HEAD> after <CFHTMLHEAD, even as the last line in your template, and text added by <CFHTMLHEAD will still be inserted inside the <HEAD>...</HEAD> pair which proves that the action is performed at time the output buffer is sent and not at the moment <CFHTMLHEAD is executed. My understanding is that the RESET action is executed first, then the <CFHTMLHEAD action. This last operation shoud be canceled by the RESET and it is not. IMHO it is definitely a bug. >>Once you use any functionality that explicitly writes part of the response (CFHTMLHEAD, CFHEADER, etc) you can't use functionality that lets you manipulate the storage buffer (CFCONTENT, CFFLUSH). I think it is actually the opposite: Once you have used CFCONTENT, CFFLUSH, you cannot use any functionality that explicitly writes part of the response (CFHTMLHEAD, CFHEADER, etc), simply because the output buffer is already gone. Look at the docs for CFHTMLHEAD: "If you use this tag after the cfflush tag on a page, an error is thrown."
|
May 23, 2013
|
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||