The attributes scope is inside the custom tag and not in the call.
You call the tag like this
<cf_selectoffices SelectedOfficeID="#SelectedOfficeID#" Debug="true">
Within the tag you must use the attributes scope.
It's always good also to do checking that the required parameters are passed
through as well. You can get the syntax for this from CF studio if you still
use it. Use the custom tag wizard. It will produce the following output.
<!--- optional attributes --->
<!--- required attributes --->
<CFLOOP index="Attribute" list="SelectedOfficeID">
<CFIF not IsDefined( 'Attributes.' & Attribute )>
<HR>
<H4>Missing Attribute</H4>
You need to specify a value for the
'<B><CFOUTPUT>#Attribute#</CFOUTPUT></B>' attribute. This attribute is
required for the <B>SelectedOfficeID</B> tag.
<HR>
<CFABORT>
</CFIF>
</CFLOOP>
-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Andrew
Dickinson
Sent: Thursday, 22 January 2004 8:55 AM
To: CFAussie Mailing List
Subject: [cfaussie] RE: custom tag weirdness
Hi Steve and Ryan
Still no difference.
Steve, I've inserted the diagnostic code as the top, but CF isn't even
getting that far. It's still stopping at the tag call i.e. :
"
<cf_selectoffices SelectedOfficeID="#attributes.SelectedOfficeID#"
Debug="true"> "
The word "attributes" makes no difference.
> Andrew
>
> Firstly, you dont need <CFOUTPUT> around queries. CFQUERY processes
> all outputs within the CFQUERY block anyway.
>
> Put this in your customTag at the top of the file
>
> <cfif isDefined("Attributes.Debug")>
> <cfdump var="#Attributes#"><cfabort>
> </cfif>
>
>
> then pass your values into your custom tag like this
>
> <cf_selectoffices SelectedOfficeID="#SelectedOfficeID#" Debug="true">
>
> what this will do is dump the attributes and their values to the
> screen
>
> My guess is that the "SelectedOfficeID" value being passed in is
> making the query error
>
> Regards
> Steve
>
> -----Original Message-----
> From: [EMAIL PROTECTED]
> [mailto:[EMAIL PROTECTED] Behalf Of Andrew
> Dickinson
> Sent: Thursday, 22 January 2004 9:29 AM
> To: CFAussie Mailing List
> Subject: [cfaussie] custom tag weirdness
>
>
> My first tag is not going according to plan.
>
> I'm attempting to reuse this code :
>
> <cfoutput>
> <cfquery name="getOfficeLocs" datasource="mydata">
> SELECT YOfficeID AS SelectedOfficeID, OfficeName
> FROM YesOffices
> WHERE Active = 1
> ORDER BY OfficeName
> </cfquery>
> <cfquery name="getSelectedOffice" datasource="mydata">
> SELECT YOfficeID AS SelectedOfficeID, OfficeName
> FROM YesOffices
> WHERE Active = 1
> and Yofficeid=#SelectedOfficeID#
> </cfquery>
> </cfoutput>
>
> ... which sets up for a dropdown menu.
>
> I've saved this code as SelectOffices.cfm, and called it as
> <cf_selectoffices> - this is as the CFMX reference manual suggests.
>
> The problem seems to be the parameter. When I modify the call to
> <cf_selectoffices SelectedOfficeID="#SelectedOfficeID#">
> it falls over, pointing to an error on this line
> "and Yofficeid=#SelectedOfficeID#"
>
> So I went back to the book and followed the starter example, wihch
> simply creates a file called date.cfm containing today's date, then
> calls <cf_date> from a different program. This works. However, when I
> try to pass a parameter, any parameter, using any of the methods in
> the book, it doesn't work (i.e throws an error).
>
> What am I missing here ?
>
>
>
>
>
>
>
> ---
> You are currently subscribed to cfaussie as: [EMAIL PROTECTED] To
> unsubscribe send a blank email to
> [EMAIL PROTECTED]
>
> MXDU2004 + Macromedia DevCon AsiaPac + Sydney, Australia
> http://www.mxdu.com/ + 24-25 February, 2004
---
You are currently subscribed to cfaussie as: [EMAIL PROTECTED] To
unsubscribe send a blank email to [EMAIL PROTECTED]
MXDU2004 + Macromedia DevCon AsiaPac + Sydney, Australia
http://www.mxdu.com/ + 24-25 February, 2004
---
You are currently subscribed to cfaussie as: [EMAIL PROTECTED]
To unsubscribe send a blank email to [EMAIL PROTECTED]
MXDU2004 + Macromedia DevCon AsiaPac + Sydney, Australia
http://www.mxdu.com/ + 24-25 February, 2004