Watch out for the reserved event values in Model-Glue

So for the last 10 minutes or so I’ve been struggling with why Model-Glue was throwing an error about events. I have a controller that checks the value of “event” in the ViewState. This contains the name of the currently running event. For some reason, when I did one particular action, I got an error saying that the value of the event wasn’t a simple value.

This certainly didn’t make any kind of sense. Event had to be a simple value - otherwise - how would Model-Glue know what to run?

Turns out I was working on event editing (event as in calendar events). I had a line of code that did this:

<cfset arguments.event.setValue("event", createObject("component", "exchange.model.eventbean"))>

Yeah, um, not such a good idea. In case folks are curious, read this blog entry for a list of reserved words in Model-Glue.

Raymond Camden's Picture

About Raymond Camden

Raymond is a developer advocate. He focuses on JavaScript, serverless and enterprise cat demos. If you like this article, please consider visiting my Amazon Wishlist or donating via PayPal to show your support. You can even buy me a coffee!

Lafayette, LA