Hi everyone, 

I am trying to use the cfproperty validation by using the accessors="true" 
attribute in my cfcomponent, but I can't get it to work.

<cfcomponent accessors="true" output="false">

    <!--- Test Property --->
    <cfproperty name="numberEntry" hint="This is a property validation 
test" type="numeric" default="5" validate="numeric">
    <cfset this.numberEntry = "asdb"/>
 
    <cffunction name="testProperties" access="public" output="false">
        <!--- This is returning the numberEntry variable defined as a 
string --->
        <cfreturn this.numberEntry>                
    </cffunction>

</cfcomponent>

Invoking the function in the cfm file:

        <!--- Test propertiest --->
        <cfinvoke component="#APPLICATION.componentsRoot#sitewide" 
method="testProperties" returnvariable="testNumber">
            <cfinvokeargument name="numberError" value="add"/>
        </cfinvoke>
        <cfoutput>#testNumber#</cfoutput>

As an output I get the value which is asdb, but I was under the 
understanding that by using accessors and setting my cfproperty validate 
attributes that the cfproperty would validate the value.

Note: I did not set the returntype on purpose on my function because that 
would catch the error. I want to see if cfproperty would catch it. I also 
did not use cfargument to validate because I want to see how cfproperty 
validates.

Thanks in advance,
Hector Torres

-- 
-- 
You received this message because you are subscribed to the "Houston ColdFusion 
Users' Group" discussion list.
To unsubscribe, send email to [email protected]
For more options, visit http://groups.google.com/group/houcfug?hl=en

--- 
You received this message because you are subscribed to the Google Groups 
"Houston ColdFusion Users' Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to