I have been working with some of my CFCs and was setting a default property for it. I'm using the CFProperty tags and the "this" scope as I'm returning the results to a flex component. I have all of my defaults set up in my cfproperty and "this" scope and was trying to use my "init()" function to return the object. However, each time I tried to access the object, ColdFusion was throwing the error message "5". That's right, just the number 5, nothing else.
Once I had narrowed it down to the init, I saw that I was using #now()# to set a default date, and #session.userId# in the cfproperty tags. Once I removed those calculated defaults in the cfproperty tag, and just left them in the "this" scope, everything worked correctly again. Does anyone know why (even disregarding the "5" error message) using calculated defaults for cfproperty throws errors?
I guess the solution is to just use calculated defaults in the "this" scope, but I wasn't sure the reasoning behind that.
Tags:
Share
Facebook
You need to be a member of ColdFusion Community to add comments!
Join ColdFusion Community