16
CFML Language Reference
CFASSOCIATE
The CFASSOCIATE tag allows sub-tag data to be saved with the base tag. This applies to
custom tags only.
Syntax
<CFASSOCIATE BASETAG="tagname"
DATACOLLECTION="collectionname">
BASETAG
Specifies the name of the base tag.
DATACOLLECTION
Optional. Specifies the name of the structure in which the base tag stores sub-tag
data. The default is AssocAttribs.
Usage
Call this tag within a sub-tag to save sub-tag data in the base tag.
ColdFusion saves sub-tag attributes in a structure whose default name is AssocAttribs.
Use the DataCollection attribute to specify a non-default structure name. Specify a
non-default structure name when the base tag can have multiple sub tags and you
want to segregate sub-tag attributes.
If the custom tag uses an attribute collection, the attributes passed in the attribute
collection are saved as independent attribute values, with no indication that they were
grouped together in a structure within the custom tag.
Example
<!--- Find the context --->
<CFIF thisTag.executionMode is "start">
<!--- Associate attributes
This code occurs in a custom tag’s
sub tag. --->
<CFASSOCIATE BASETAG="CF_TAGBASE">
<!--- Define defaults for attributes --->
<CFPARAM NAME="attributes.happy" DEFAULT="Yes">
<CFPARAM NAME="attributes.sad" DEFAULT="No">
...
Summary of Contents for COLDFUSION 4.5-CFML LANGUAGE
Page 1: ...Allaire Corporation CFML Language Reference ColdFusion 4 5...
Page 207: ...Chapter 1 ColdFusion Tags 183 CFCATCH CFTRY BODY HTML...
Page 224: ...200 CFMLLanguageReference CFOUTPUT P Text within CFOUTPUT is always shown CFOUTPUT BODY HTML...
Page 336: ...312 CFMLLanguageReference CFIF BODY HTML...
Page 404: ...380 CFMLLanguageReference DE It is morning CFOUTPUT P BODY HTML...
Page 413: ...Chapter 2 ColdFusion Functions 389 Customer BalanceDue BR CFOUTPUT CFIF BODY HTML...
Page 483: ...Chapter 2 ColdFusion Functions 459 CFOUTPUT CFLOOP BODY HTML...
Page 584: ...560 CFMLLanguageReference...
Page 594: ...570 CFMLLanguageReference...