> Hi ppl.-
>
> I have a weird issue here, hope someone can help me a bit
>
> i have a CustomTag who needs to call some UDF's
>
> if i put the <cfscript> into the CustomTag i receive this error.
>
> The routine myfunction has been declared twice in different
> templates.
>
> The error occurred while processing an element with a general
> identifier of (), occupying document position (1:1) to (1:1)
> in the template file but i have this function only in this file.
If you want to embed a function within a custom tag, you need to ensure it
is only declared once. If, for example, you have a custom tag foo.cfm, and
you do something like this:
<cf_foo>...</cf_foo>
it will run twice. I can't remember ever wanting to embed a function within
a custom tag, but I would expect that you could use ThisTag.ExecutionMode to
figure out whether to declare it:
<cfif ThisTag.ExecutionMode is "start">
<cffunction ...></cffunction>
</cfif>
Alternatively, you could simply put the functions in a CFC or in a
persistent scope to get to them from within your custom tag.
> i tried put the UDF's in another file and then using
> cfmodule adding the UDF files, this include the files (i can
> see parsed cfoutputs in there )but can see the functions.-
The CFMODULE tag doesn't just include code like CFINCLUDE does. If you place
functions within another custom tag, those functions will not be available
in your custom tag just because you call the other custom tag.
Dave Watts, CTO, Fig Leaf Software
http://www.figleaf.com/
Fig Leaf Software provides the highest caliber vendor-authorized
instruction at our training centers in Washington DC, Atlanta,
Chicago, Baltimore, Northern Virginia, or on-site at your location.
Visit http://training.figleaf.com/ for more information!
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Logware (www.logware.us): a new and convenient web-based time tracking
application. Start tracking and documenting hours spent on a project or with a
client with Logware today. Try it for free with a 15 day trial account.
http://www.houseoffusion.com/banners/view.cfm?bannerid=67
Message: http://www.houseoffusion.com/lists.cfm/link=i:4:204781
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