Reactor mixed case gotcha
It has come up on the Reactor mailing list that since the Coldfusion XML functions are all case specific,
extra care has to be taken to be sure the db fields and the reacor.xml <object> definitions and subtags all match in case.
Care must also be taken when throwing custom validation messages.
<CFSET arguments.ErrorCollection.addError("emailAddress.emailAddress.NoAtSign") />Is different from:
<CFSET arguments.ErrorCollection.addError("EmailAddress.emailAddress.NoAtSign") />Which ever variation does not exactly match the dictionary.xml file for that object will throw an exception:
Message An error occured while Transforming an XML document.
Detail Empty expression!So after painstakingly making sure all the DB fields (dev and production) matched the object tags, that matched the validation error definitions, that matched the case in the dictionary.xml files, I mysteriously received the error again. But this time it worked in one place in the app, and not in another, both using almost identical code. The only difference was what the reactorfactory was passed as the object name.
Reactor.createRecord("emailAddress") />is not the same as:
Reactor.createRecord("EmailAddress") />I currenly develop mainly in coldfusion/IIS, but these three mixed case gotchas have really gotten me thinking about becoming more aware of case no matter what I am coding. Maybe I can make make case consistancy second nature before I switch languages/platforms and really need it.
delicious |
digg |
reddit |
technorati
