I'm working on a Mach-ii application but I think this is more of a cfscript
question so I'm posting it here. I have a filter that I am trying to set up
so that I can pass it the name of getter method through the event arguments
and then execute it - the problem I am having is that it simply sees the
variable as a string and doesn't execute it. If I was using cfml I could
build the string and pound it to get the value but I don't know how to do
that in cfscript (or if it's possible). I can probably set up a switch
statement to cover what I need but I was hoping to make the filter dynamic
enough that I could just pass it the object name and the method and go from
there.
This works:
<cfscript>
var ObjectName = "";
var invalidEvent = "";
var clearEventQueue = false;
. . .
if ( arguments.event.getArg( objectName ).getSb_Id()
neq '' ) {
return true; // allow processing to continue
} else {
if ( clearEventQueue ) {
arguments.eventContext.clearEventQueue();
}
. . .
But if I try to pass in the getSb_Id() as an argument then it gets upset:
<cfscript>
var ObjectName = "";
var invalidEvent = "";
var clearEventQueue = false;
var getter = "";
. . .
if ( structKeyExists( arguments.paramArgs, "getter" ) )
{
getter = arguments.paramArgs.getter;
} else
{
getter = getParameter( "getter", "" );
. . .
if ( arguments.event.getArg( objectName ).getter neq ''
) {
return true; // allow processing to continue
} else {
Any ideas?
Thanks - Kirk
----------------------------------------------------------
You are subscribed to cfcdev. To unsubscribe, send an email to
[email protected] with the words 'unsubscribe cfcdev' as the subject of the
email.
CFCDev is run by CFCZone (www.cfczone.org) and supported by CFXHosting
(www.cfxhosting.com).
CFCDev is supported by New Atlanta, makers of BlueDragon
http://www.newatlanta.com/products/bluedragon/index.cfm
An archive of the CFCDev list is available at
www.mail-archive.com/[email protected]