1
votes

I am using a custom tag and am getting an Invalid CFML Construct error on the following:

Invalid CFML construct found on line 27 at column 10.

26 : <cfscript>
27 : cfparam( 'attributes.action', 'new' );
28 : cfparam( 'attributes.fieldList', '' );
29 : cfparam( 'attributes.return', 'variables' );
1
Sometimes CF gives the wrong line number. Please add lines 15-25 to your question. - Dan Bracuk
What version of ColdFusion? - James A Mohler

1 Answers

4
votes

You are using incorrect syntax for param. I think you have got the cfparam mistaken for a simple ColdFusion function. For cfparam you need to specify the parameters with names like name, default when passing the data. Not as just the values for comma separated values like you can do for a normal function (like listfind(list, 'str')).

<cfscript>
  cfparam(name="attributes.action", default='new');
  param name="attributes.action" default='new';
</cfscript>

And the short hand syntax is param attributes.action ='new';