Using both AttributeCollection and other Attributes with ColdFusion tags in CF 8.0.1

  Jul 18, 2008     5849 Views      ColdFusion       Comments (1)   

The ColdFusion 8 AttributeCollection is one of the coolest features with ColdFusion 8 Release. The ColdFusion 8.0.1 release gave some enhancements to AttributeCollection which is nothing but combining both attributes and attributecollection with a ColdFusion tag. We can use attributecollection like this

<!--- Creating attributecollection name/value pairs for cfmail tag --->

<cfset objMailAttributes = {
Server = "mail.mycompany.com",
Username = "companyxyz",
Password = "zyxcompany",
To = "tomail@mycompany.com",
From = "frommail@mycompany.com",
Subject = "Using AttributeCollection and Attributes in CF8",
Type = "plain"

} />


<!--- Using attributecollection structure in the cfmail tag --->

<cfmail attributecollection = "#objMailAttributes#" type="html">
<p>
Now we can use both AttributeCollection and Attributes with ColdFusion tags in CF 8.0.1
</p>
</cfmail>

In the above code I have added an attribute type with value "html". So if an individual attribute is already defined in the attributecollection then ColdFusion will only use the individual attribute value. Executing the above code with CF 8.0.0 will throw you an error like below.

The attributeCollection attribute cannot be used in
combination with other attributes in the cfmail tag.

Related Information:

ColdFusion 8 Update 1 Download Link:
http://www.adobe.com/support/coldfusion/downloads_updates.html#cf8

ColdFusion 8 Livedocs about AttributeCollection:
http://livedocs.adobe.com/coldfusion/8/htmldocs/help.html?content=Elements_04.html

Ben Nadel Blog Entry About AttributeCollection in CF8:
http://www.bennadel.com/blog/755-Learning-ColdFusion-8-Defining-Tags-With-AttributeCollection.htm

Comments

1. Chris Bowyer on Mar 30, 2013 at 8:14 AM

Thanks for this article. You answered my question.

About Me

CFML/Web/Salesforce/Agile Enthusiast, Husband & Dad, an avid learner & android fan. Creator of GetCFMLJobs.com who works as a Tech Consultant in Toronto, Canada.

GetCFMLJobs.com!
Get Your Next CFML Job!
ColdFusion Tuts
ColdFusion Tutorials & Resources


Categories

Adobe Agile AppCore Creator BlogCFC Books Bootstrap CFBuilder CFEclipse CFML Chennai CFUG Chrome Extensions ColdFusion Google IIS India Learning MySQL Railo Subversion Tools & Utilities Web Windows 7


Archives

2018 2017 2016 2014 2013 2012 2011 2010 2009 2008

Search


Akbarsait © 2008 - 2019 | Hosting provided by Vivio Technologies

Home | Blog | Sitemap | RSS Feed