I believe this is due to the "trinary" (not sure if that is a word)
nature of CFC methods. Basically, output in CFC work 3 different ways.
One way if you do NOT have output=, one if you do and its true, and
one if you do and it's false. Normall you do not leave it off as you
have below. If you add output=false, use cfoutput inside your
cfsavecontent, it should work as you expected.

I believe Sean Corfield has a good blog on post on this "3-way" issue.
But to make things safe (and simple) just don' tleave it off.

On 1/19/06, Russ <[EMAIL PROTECTED]> wrote:
> I'm wondering if this should be reported as a bug.  Basically cfsavecontent
> works in unexpected ways.  For example, lets say we have a component that
> has a method called test, which returns a string.
>
>
>
> <cffunction name="test" returntype="string">
>
>   <cfset var str="">
>
>   <cfsavecontent variable="str">
>
>     test
>
>   </cfsavecontent>
>
>  <cfreturn str>
>
> </cffunction>
>
>
>
> The following 2 code listings do completely different things even though it
> wouldn't look like it from the first glance.  Please note that I haven't
> tested this code, so it might not compile, but you should get the gyst of
> it.  Code listing 1 would output "test", while code listing 2 would output
> an empty string.  To me, that doesn't work as expected.  Should this be
> considered a bug and possibly fixed in future versions of CF, or is it just
> me?
>
>
>
> Code listing 1
>
> <cfoutput>
>
> <cfinvoke component "test" method="test"  returnVariable="myStr">
>
> #mystr#
>
> </cfoutput>
>
>
>
> Code listing 2
>
> <cfinvoke component "test" method="test"  returnVariable="myStr">
>
> <cfoutput>
>
> #mystr#
>
> </cfoutput>
>
>
>
>
>
> 

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Message: http://www.houseoffusion.com/lists.cfm/link=i:4:230027
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4
Donations & Support: http://www.houseoffusion.com/tiny.cfm/54

Reply via email to