cfparam only works when type="any" and default=""
I am trying to add cfparam to a custom tag to validate the data. However, it always errors on valid data.
This works:
<!--- this is page test2.cfm --->
<cfmodule template = "components/test2component.cfm" columns=14 >
<!--- This is components/test2component.cfm --->
<cfparam name="columns" type="any" default="">
<cfoutput> #attributes.columns# </cfoutput>
<a href="#goTop" title="Go to top of page">Top</a>
<!--- the output is --->
14 <a href="#goTop" title="Go to top of page">Top</a>
-----------------------------------------------------------------------------------------
But when I change the component to:
<cfparam name="columns" type="integer" default="">
<cfoutput> #attributes.columns# </cfoutput>
<a href="#goTop" title="Go to top of page">Top</a>
I get this:
Invalid parameter type.
The value specified, '', must be a valid integer.
-----------------------------------------------------
When I change the component to:
<cfparam name="columns" type="integer">
<cfoutput> #attributes.columns# </cfoutput>
<a href="#goTop" title="Go to top of page">Top</a>
I get this:
The required parameter columns was not provided.
This page uses the cfparam tag to declare the parameter columns as required for this template. The parameter is not available. Ensure that you have passed or initialized the parameter correctly. To set a default value for the parameter, use the default attribute of the cfparam tag. The error occurred in D:\Inetpub\wwwroot\endpoints\components\test2component.cfm: line 19
Any suggestions?
