yep, it was my mistake... I am thinking of a workaround now......... but at the momemnt its working?....
-----Original Message----- From: Raymond Camden [mailto:[EMAIL PROTECTED]] Sent: 22 August 2002 14:37 To: CF-Talk Subject: RE: Caller problem > > Uurgh... Okay heres the code.....() this works..... as the > query is on the > same page as the tag... > > <!--- I need to think about how to get it into a tag ---> > <cfquery name="getUsers" > datasource="#request.ssa.event["datasource"]#"> > SELECT VAR_Au_Login AS USERNAME, VAR_AU_Password AS PASSWORD, > K_AU_ID,DAT_AU_PasswordDate > FROM Application_Users > </cfquery> > > > <cf_authenticate query="getUsers"> Again - this may work - but it's a bad idea for custom tags to arbitrarily read stuff in the caller scope. I'd change it so that you actually pass in the query - and don't forget that queries are passed by reference, so you should probably do this instead: <cf_auth query="#duplicate(getUsers)#"> > ======================= > > as soon as I place the query in a tag thus : > > <cf_usercontroller > datasource="#request.ssa.event["datasource"]#"method="get"> > > where get is a case value which ONLY has the query syntax > above.....if I > then try and pass getUsers into <cf_authenticate> it fails asking for > caller.CFQUERYNAME.columnlist, ... Wait - now I'm confused. Are you syaing that you call 2 custom tags? If so, it makes sense that if the query is defined in the first CT it can't be used in the second. You -must- remember that CTs have their own scope. Imagine this scenario: <cf_foo> <cf_goo> If foo.cfm sets x to 1, this variable only exists inside of foo. goo cannot read this value. In order for goo to use crap from foo, foo needs to pass the information back: foo.cfm: <cfset x = someValue()> <cfset "caller.x" = x> Now the page has a value called X. However, you still must pass this in to goo: <cf_goo x="#x#"> On another note - custom tags should not simply set a variable. They should take an attribute which determines what variable name they should return. Why? If foo ALWAYS sets "x" in the caller scope, that would mean you couldn't do this: <cf_foo> <cf_foo> <cf_foo> Each time you call foo, the value of x will get set. So in this case, you will lose whatever x was the first two times. Normally, I design my custom tags to take an attribute which determines the variable name to return. <cf_foo r_value="x"> <cf_foo r_value="y"> <cf_foo r_value="z"> Inside, the code simply does: <cfset "caller.#attributes.r_value#" = x> You can also use cfparam/type="variableName" to ensure the value passed is a valid variable name. ======================================================================= Raymond Camden, ColdFusion Jedi Master for Hire Email : [EMAIL PROTECTED] Yahoo IM : cfjedimaster "My ally is the Force, and a powerful ally it is." - Yoda ______________________________________________________________________ Get the mailserver that powers this list at http://www.coolfusion.com FAQ: http://www.thenetprofits.co.uk/coldfusion/faq Archives: http://www.mail-archive.com/[email protected]/ Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists

