Title:
Bug 78591:(Watson Migration Closure)Summary: implement CFC-based custom tags as per Railo
| View in TrackerStatus/Resolution/Reason: Closed/Deferred/
Reporter/Name(from Bugbase): Adam Cameron / Adam Cameron (Adam Cameron)
Created: 07/07/2009
Components: Language, CustomTag
Versions: 9.0
Failure Type: Unspecified
Found In Build/Fixed In Build: 233019 /
Priority/Frequency: Normal / Unknown
Locale/System: English / Platforms All
Vote Count: 2
Problem:
Summary: implement CFC-based custom tags as per Railo
Railo has implemented CFC-based custom tags, detailed here:
http://www.railo.ch/blog/index.cfm/2009/6/2/CFCbased-Custom-Tags-by-Example--Part-1
http://www.railo.ch/blog/index.cfm/2009/6/4/CFCbased-Custom-Tags-by-Example--Part-2
http://www.railo.ch/blog/index.cfm/2009/6/12/CFCbased-Custom-Tags-by-Example--Part-3
In summary the tag CFC has two main event handlers: onTagStart and onTagEnd which are method-equivalents of the two similar execution modes from CFM-based custom tags. There are also init(), onError() and onFinally() methods catered for too.
This would be quite handy for CF as well, I think.
There's a lengthy discussion on this notion here:
https://prerelease.adobe.com/project/forum/thread.html?cap=87529BDA13744B3DB718E841890B9240&forid={81302E9C-2163-4C37-9582-D9C14B236AE8}&topid={067029D2-B68F-4EC4-AC01-B1AD11A5E5DA}&tp=1
Opinion certainly was divided (and divisive!), so it's worth getting the full picture (such as it is).
Cheers.
--
Adam
Method:
This is lifted from the blog entry above. Apologies for any (c) considerations:
<cfcomponent>
<cffunction name="onStartTag" output="yes" returntype="boolean"
hint="invoked before the body of the tag is executed, return value define if body should be executed or not (default is true)">
<cfargument name="attributes" type="struct" required="yes"
hint="attribute collection provided by tag caller, same as attribute scope in cfm based custom tags">
<cfargument name="caller" type="struct" required="yes"
hint="variable scope of the caller, same as caller scope in cfm based custom tags">
<cfparam name="attributes.name" default="World">
Hello #attributes.name#
<cfreturn true>
</cffunction>
</cfcomponent>
Result:
----------------------------- Additional Watson Details -----------------------------
Watson Bug ID: 3039175
External Customer Info:
External Company:
External Customer Name: Adam Cameron
External Customer Email: 17EB1A7649DA54C7992015A9
External Test Config: 07/07/2009
Attachments:
Comments: