udf in custom tag, problem with end tag

2001-11-30 Thread C Runyan

I found that a udf created on a page is not available inside custom tags.  I 
just put a copy of the code into the custom tag.  That works.  Now I want to 
call the same tag more than once and that works as long as it is only 
defined the first time the tag is called.  The problem comes if I use an end 
tag.  It simply doesn't work.  If anyone else has tried this and gotten it 
to work let me know.

-(customtag.cfm)
cfoutputbr#ThisTag.ExecutionMode#br/cfoutput
cfif NOT ISDefined(caller.alreadycreated)
cfoutput*inside if statement*br/cfoutput
cfscript
  function iudf() {return function output;}
  caller.alreadycreated = Yes;
/cfscript
/cfif
-(callcustomtag.cfm)
cf_customtag
cf_customtag
cf_customtag/cf_customtag
-

The error only occurs on the end tag for some reason.  If the function 
definition is commented out it works fine.  I've reduced the code down as 
simple as I can to try to figure this out.

Chris Runyan




~~
Your ad could be here. Monies from ads go to support these lists and provide more 
resources for the community. http://www.fusionauthority.com/ads.cfm
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists



RE: udf in custom tag, problem with end tag

2001-11-30 Thread Raymond Camden

This is a known issue. You cannot define UDFs in CTs that are used in
Begin/End fashion as you have shown below. You can get around this by
moving the UDF to an include and doing a CFINCLUDE from the CT.

===
Raymond Camden, Principal Spectra Compliance Engineer for Macromedia

Email: [EMAIL PROTECTED]
Yahoo IM : morpheus

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

 -Original Message-
 From: C Runyan [mailto:[EMAIL PROTECTED]] 
 Sent: Friday, November 30, 2001 3:26 PM
 To: CF-Talk
 Subject: udf in custom tag, problem with end tag
 
 
 I found that a udf created on a page is not available inside 
 custom tags.  I 
 just put a copy of the code into the custom tag.  That works. 
  Now I want to 
 call the same tag more than once and that works as long as it is only 
 defined the first time the tag is called.  The problem comes 
 if I use an end 
 tag.  It simply doesn't work.  If anyone else has tried this 
 and gotten it 
 to work let me know.
 
 -(customtag.cfm)
 cfoutputbr#ThisTag.ExecutionMode#br/cfoutput
 cfif NOT ISDefined(caller.alreadycreated)
   cfoutput*inside if statement*br/cfoutput
   cfscript
 function iudf() {return function output;}
 caller.alreadycreated = Yes;
   /cfscript
 /cfif
 -(callcustomtag.cfm)
 cf_customtag
 cf_customtag
 cf_customtag/cf_customtag
 -
 
 The error only occurs on the end tag for some reason.  If the 
 function 
 definition is commented out it works fine.  I've reduced the 
 code down as 
 simple as I can to try to figure this out.
 
 Chris Runyan
 
 
 
 
 
~~
Your ad could be here. Monies from ads go to support these lists and provide more 
resources for the community. http://www.fusionauthority.com/ads.cfm
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists



Re: udf in custom tag, problem with end tag

2001-11-30 Thread Jamie Jackson

shot_in_the_dark certainty=null
Two things to play with:
*Try using the request scope instead of the caller scope. Line 2 of
your custom tag looks suspect to me.
*Try clearing out thistag.generatedcontent, as it's screwed me up
before.
/shot_in_the_dark

I doubt if this will help, but if you're grasping...

Jamie

On Fri, 30 Nov 2001 20:25:36 +, in cf-talk you wrote:

I found that a udf created on a page is not available inside custom 
tags.  I 
just put a copy of the code into the custom tag.  That works.  Now I 
want to 
call the same tag more than once and that works as long as it is only 
defined the first time the tag is called.  The problem comes if I use an
 end 
tag.  It simply doesn't work.  If anyone else has tried this and gotten 
it 
to work let me know.

-(customtag.cfm)
cfoutputbr#ThisTag.ExecutionMode#br/cfoutput
cfif NOT ISDefined(caller.alreadycreated)
   cfoutput*inside if statement*br/cfoutput
   cfscript
 function iudf() {return function output;}
 caller.alreadycreated = Yes;
   /cfscript
/cfif
-(callcustomtag.cfm)
cf_customtag
cf_customtag
cf_customtag/cf_customtag
-

The error only occurs on the end tag for some reason.  If the function 
definition is commented out it works fine.  I've reduced the code down 
as 
simple as I can to try to figure this out.

Chris Runyan





~~
Structure your ColdFusion code with Fusebox. Get the official book at 
http://www.fusionauthority.com/bkinfo.cfm
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists



RE: udf in custom tag, problem with end tag

2001-11-30 Thread C Runyan

Thanks for the tip, nice to know it's the compiler and not me.  I was about 
to try that but wanted to make sure I wasn't missing something about how 
udf's are supposed to work.

Chris

From: Raymond Camden [EMAIL PROTECTED]
Reply-To: [EMAIL PROTECTED]
To: CF-Talk [EMAIL PROTECTED]
Subject: RE: udf in custom tag, problem with end tag
Date: Fri, 30 Nov 2001 15:35:25 -0500

This is a known issue. You cannot define UDFs in CTs that are used in
Begin/End fashion as you have shown below. You can get around this by
moving the UDF to an include and doing a CFINCLUDE from the CT.

===
Raymond Camden, Principal Spectra Compliance Engineer for Macromedia

Email: [EMAIL PROTECTED]
Yahoo IM : morpheus

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

  -Original Message-
  From: C Runyan [mailto:[EMAIL PROTECTED]]
  Sent: Friday, November 30, 2001 3:26 PM
  To: CF-Talk
  Subject: udf in custom tag, problem with end tag
 
 
  I found that a udf created on a page is not available inside
  custom tags.  I
  just put a copy of the code into the custom tag.  That works.
   Now I want to
  call the same tag more than once and that works as long as it is only
  defined the first time the tag is called.  The problem comes
  if I use an end
  tag.  It simply doesn't work.  If anyone else has tried this
  and gotten it
  to work let me know.
 
  -(customtag.cfm)
  cfoutputbr#ThisTag.ExecutionMode#br/cfoutput
  cfif NOT ISDefined(caller.alreadycreated)
  cfoutput*inside if statement*br/cfoutput
  cfscript
function iudf() {return function output;}
caller.alreadycreated = Yes;
  /cfscript
  /cfif
  -(callcustomtag.cfm)
  cf_customtag
  cf_customtag
  cf_customtag/cf_customtag
  -
 
  The error only occurs on the end tag for some reason.  If the
  function
  definition is commented out it works fine.  I've reduced the
  code down as
  simple as I can to try to figure this out.
 
  Chris Runyan
 
 
 
 
 

~~
Your ad could be here. Monies from ads go to support these lists and provide more 
resources for the community. http://www.fusionauthority.com/ads.cfm
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists