Unless I'm missing a typo, it looks correct to me. Maybe cfparam gets
confused by the path? What happens if you change the first cfparam to:

<cfif not isDefined("attributes.cfg")>
        <cfset attributes.cfg = structNew()>
</cfif>
<cfif not structKeyExists(attributes.cfg,"param1")>
        <cfset attributes.cfg.param1 = "no">
</cfif>

========================================================================
===
Raymond Camden, ColdFusion Jedi Master for Mindseye, Inc
(www.mindseye.com)
Member of Team Macromedia (http://www.macromedia.com/go/teammacromedia)

Email    : [EMAIL PROTECTED]
Blog     : www.camdenfamily.com/morpheus/blog
Yahoo IM : morpheus

"My ally is the Force, and a powerful ally it is." - Yoda 

> -----Original Message-----
> From: Jim McAtee [mailto:[EMAIL PROTECTED] 
> Sent: Monday, September 15, 2003 12:36 PM
> To: CF-Talk
> Subject: Passing a Struct to a Custom Tag
> 
> 
> How do you pass a struct as an attribute to a custom tag? (CF5)
> 
> I've got an app structured something like:
> 
> <!--- application.cfm --->
> <cfset cfg = StructNew()>
> <cfset cfg.param1 = "yes">
> <cfset cfg.param2 = "20">
> 
> <!--- mypage.cfm --->
> <cfinclude template="header.cfm">
> <cf_mytag cfg="#cfg#">
> <cfinclude template="footer.cfm">
> 
> <!--- mytag.cfm --->
> <cfparam name="attributes.cfg.param1"   default="no">
> <cfparam name="attributes.cfg.param2"   default="100">
> <cfoutput>
> #attributes.cfg.param1#<br>
> #attributes.cfg.param2#<br>
> </cfoutput>
> 
> And always get as output
> 
> no
> 100
> 
> I realize that I haven't yet dealt with the issue of CF 
> passing structs by reference, but it seems that the <cfparam> 
> tags shouldn't alter the variables in this instance.  
> Obviously I'm doing something else wrong.
> 
> 
> 
> 
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Archives: http://www.houseoffusion.com/lists.cfm?link=t:4
Subscription: http://www.houseoffusion.com/lists.cfm?link=s:4
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4

Get the mailserver that powers this list at 
http://www.coolfusion.com

Reply via email to