This is a thread from a discussion I had on the cfguru list. In this last post from Kevin I realized my issue might not be CF in general but OpenBD. Thoughts...

Sent from my iPhone

Begin forwarded message:

From: "Kevin J. Miller" <[email protected]>
Date: March 7, 2010 3:22:28 AM EST
To: "'ColdFusion Guru List'" <[email protected]>
Subject: RE: CFGURU: <cfthread> and Custom Tag
Reply-To: ColdFusion Guru List <[email protected]>


Derrick,



This works for me, so not sure if I'm misunderstanding the issue.



cfthreadtest.cfm



<cfset form.message = "I exist in the page's variables scope.">



<cfthread action="run" name="t1" myvar="#form#">



            <cfsavecontent variable="threadattributes">

                        <cfdump var="#attributes#">

            </cfsavecontent>



<cffile action="WRITE" file="#expandpath ("threadattributes.html")#" output="#threadattributes#" addnewline="No">



            <cf_threadcustomtag anothervar="#attributes.myvar#">



</cfthread>



Then in threadcustomtag.cfm:



<cfsavecontent variable="customtagattributes">

            <cfdump var="#attributes#">

</cfsavecontent>



<cffile action="WRITE" file="#expandpath("customtagttributes.html") #" output="#customtagattributes#" addnewline="No">







From: [email protected] [mailto:cfguru- [email protected]] On Behalf Of Derrick Jackson
Sent: Saturday, March 06, 2010 10:44 PM
To: ColdFusion Guru List
Cc: ColdFusion Guru List
Subject: Re: CFGURU: <cfthread> and Custom Tag



Thanks Kevin.



My thread actually is setting variables that I want to pass to the custom tag. So in my thread I have this <cf_tag name=var1 Action=var2/>. However if I do a dump of the attributes within the custom tag that struct is blank. Am I missing some crucial part.

Sent from my iPhone


On Mar 6, 2010, at 11:09 AM, "Kevin J. Miller" <[email protected]> wrote:

You need to pass any 'outside' values into the thread as attributes.



<cfthread action="run" name="thread1" theform="#form#">



Then the struct, theform will be available within the thread, and should be passed to the custom tag. The issue is the unique scoping of cfthread; look up thread scopes in the docs for cfthread.



HTH,

Kevin





From: [email protected] [mailto:cfguru- [email protected]] On Behalf Of Derrick Jackson
Sent: Saturday, March 06, 2010 5:38 PM
To: ColdFusion Guru List
Subject: CFGURU: <cfthread> and Custom Tag



Folks,

This may be a simple situation/solution, but I have an app with the following setup:

App generates <cfhttp> request to a URL and passes in formFields
The <cfhttp>'d page has its code wrapped inside a <cfthread> block.
Inside that block is also a custom tag.

When I execute the code within this page via the <cfhttp> call, the attributes struct that is passed to the custom tag is blank. However if I remove the <cfthread> block from around my code the page does exactly what I want. Is there something about <cfthread> and custom tags that I'm missing?

Sorry if this is an elementary question.

Thanks,
Derrick

_______________________________________________
cfguru mailing list
[email protected]
http://www.granularity.net/mailman/listinfo/cfguru

_______________________________________________
cfguru mailing list
[email protected]
http://www.granularity.net/mailman/listinfo/cfguru

--
Open BlueDragon Public Mailing List
http://www.openbluedragon.org/   http://twitter.com/OpenBlueDragon
mailing list - http://groups.google.com/group/openbd?hl=en

!! save a network - please trim replies before posting !!

Reply via email to