Model-Glue: What is reserved in the view state?

Someone asked me on IRC yesterday what values are reserved in the viewState for Model-Glue. Since Model-Glue doesn't have the best documentation yet (poke Joe!), I pinged him and did a bit of testing. There are currently only four values that exist by default. You should avoid using a viewState/event arg value with these names:

  • event: The name of the current event. This could be useful for debugging/logging.
  • eventValue: I believe this is simply the URL variable checked for events. Model-Glue lets you configure this. I've never had a need to though.
  • myself: A link back home. This is useful in building links back to your Model-Glue app, as you can use this value and just append the link, like so: <a href="#viewState.getValue("myself")#eventNNN">
  • self: This is the value that tripped up my friend on IRC. As far as I know it is just a pointer to the file name of the core Model-Glue file (index.cfm typically).

Comments

raZorTT's Gravatar G'day Ray,

I found this blog post after a quick search on google for reserved words in model-glue. I came across an issue with a form field named "version" in on of my apps.

Do you know if there is a more extensive list of reserved words anywhere?

http://blog.constantconfusion.com/2009/02/26/reser...

Cheers,
Simon
# Posted By raZorTT | 2/25/09 9:16 PM
Raymond Camden's Gravatar Version shouldn't be reserved. Was this with MG3?
# Posted By Raymond Camden | 2/25/09 9:39 PM
raZorTT's Gravatar I think we have version 2.0.304
# Posted By raZorTT | 2/25/09 9:47 PM
Raymond Camden's Gravatar Looking at your blog post - I'm not so sure this is a conflict w/ the core MG files. I think it might be something else. Maybe try some intensive logging?
# Posted By Raymond Camden | 2/25/09 9:49 PM
raZorTT's Gravatar MG wouldn't modify the form struct after a submission would it?

I dumped out form as well as the event struct and both had been changed. It is looking like something else might be the culprit.

Cheers,
Simon
# Posted By raZorTT | 2/25/09 10:43 PM
Raymond Camden's Gravatar Try adding some debugging to your Application.cfm file. Ie, log form.version. This will be run before MG does anything.
# Posted By Raymond Camden | 2/26/09 6:15 AM