I am trying to write a complex custom tag that does paged output of a query:
<CF_OutputPage query="myquery" startrow=1 maxrows=10>
...stuff with #myquery.column# ...
</CF_OutputPage>
<!--- returns: outputpage.numpages, outputpage.thispage, outputpage.prevstart,
outputpage.nextstart --->
The easiest way is the following:
If ExecutionMode is 'start', calculate number of pages, prevstart, nextstart, etc.
return those in caller.outputpage.#var#, and somehow "spit out" a CFOUTPUT:
<CFOUTPUT QUERY="#attributes.query#" STARTROW="#attributes.startrow#"
MAXROWS="#attributes.maxrows#">
If ExecutionMode is 'end', just "spit out" the close CFOUTPUT:
</CFOUTPUT>
But this doesn't work. No matter how I try to "spit out" <CFOUTPUT> I either get
nesting errors because I am opening a CFOUTPUT in the module without closing it, OR I
get the actual text "<CFOUTPUT>" in my browser source (Explorer doesn't do a whole lot
when it sees <CFOUTPUT> :-) )
I thought I was *really* clever when I tried this:
ThisTag.GeneratedContent = "<cfoutput query=""#attributes.query#""
startrow=#attributes.startrow# maxrows=#attributes.maxrows#>" &
ThisTag.GeneratedContent & "</cfoutput>";
But I still just got this text in my browser source :-(
Is there any way to "spit out" CFML like a macro for the calling tag to use?
The only other way I can think of is *nasty*. I would have to set up local variables
for each column and manually do the subtitutions by evaluating the GeneratedContent,
then use <CFEXIT METHOD="loop"> to loop through each row of the result set. oooph!
At 03:08 PM 8/11/00 -0700, Justin Kidman wrote:
>You say: <cfmodule template="MyTag.cfm"> ... stuff... </cfmodule>
>
>Justin Kidman
>
>-----Original Message-----
>From: Peter Theobald [mailto:[EMAIL PROTECTED]]
>Sent: Friday, August 11, 2000 2:54 PM
>To: [EMAIL PROTECTED]; [EMAIL PROTECTED]
>Subject: Custom Nesting Tag
>
>
>I'm creating a custom tag that has a start and end, ie: <CF_MyTag> ...
>stuff... </CF_MyTag>
>
>In the tag I test ThisTag.ExecutionMode to see if I should be handling the
>start or end processing.
>
>Here's my question:
>I MUCH prefer to use the explicit syntax: <CFMODULE TEMPLATE="MyTag.cfm">
>than the <cf_MyTag> syntax because it's faster and clearer. However I don't
>know how to specify the END tag with that syntax.
>
>Do I say: <cfmodule template="MyTag.cfm"> ... stuff... </cfmodule>
>Do I say: <cfmodule template="MyTag.cfm"> ... stuff... </CF_MyTag>
>Neither of these looks right.
>
>Do I have to say: <CF_MyTag> ... stuff ... </CF_MyTag>
>
>?
>
>
>
>---------------------------------------------------------------------------
>Peter Theobald, Chief Technology Officer
>LiquidStreaming http://www.liquidstreaming.com
>[EMAIL PROTECTED]
>Phone 1.212.545.1232 Fax 1.212.679.8032
>
>----------------------------------------------------------------------------
>--
>Archives: http://www.mail-archive.com/[email protected]/
>To Unsubscribe visit
>http://www.houseoffusion.com/index.cfm?sidebar=lists&body=lists/cf_talk or
>send a message to [EMAIL PROTECTED] with 'unsubscribe' in
>the body.
>------------------------------------------------------------------------------
>Archives: http://www.mail-archive.com/[email protected]/
>To Unsubscribe visit
>http://www.houseoffusion.com/index.cfm?sidebar=lists&body=lists/cf_talk or send a
>message to [EMAIL PROTECTED] with 'unsubscribe' in the body.
---------------------------------------------------------------------------
Peter Theobald, Chief Technology Officer
LiquidStreaming http://www.liquidstreaming.com
[EMAIL PROTECTED]
Phone 1.212.545.1232 Fax 1.212.679.8032
------------------------------------------------------------------------------
Archives: http://www.mail-archive.com/[email protected]/
To Unsubscribe visit
http://www.houseoffusion.com/index.cfm?sidebar=lists&body=lists/cf_talk or send a
message to [EMAIL PROTECTED] with 'unsubscribe' in the body.