cfassociate

Description

Allows subtag data to be saved with the base tag. Applies only to custom tags.

Category

Web application framework tags

Syntax


<cfassociate baseTag = "base_tag_name"

  dataCollection = "collection_name"> 

See also

cfapplication, cfauthenticate, cferror, cflock, cfmodule

Attributes

Attribute
Description
baseTag
Required. The name of the base tag.
dataCollection
Optional. The name of the structure in which the base tag stores subtag data. The default is AssocAttribs.

Usage

Call this tag within a subtag to save subtag data in the base tag.

ColdFusion saves subtag attributes in a structure whose default name is AssocAttribs. Use the DataCollection attribute to specify a different structure name. Specify a structure name when the base tag can have multiple sub tags and you want to segregate subtag 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">

...



Banner.Novgorod.Ru