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).

Archived Comments

Comment 1 by raZorTT posted on 2/26/2009 at 8:16 AM

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.constantconfusi...

Cheers,
Simon

Comment 2 by Raymond Camden posted on 2/26/2009 at 8:39 AM

Version shouldn't be reserved. Was this with MG3?

Comment 3 by raZorTT posted on 2/26/2009 at 8:47 AM

I think we have version 2.0.304

Comment 4 by Raymond Camden posted on 2/26/2009 at 8:49 AM

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?

Comment 5 by raZorTT posted on 2/26/2009 at 9:43 AM

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

Comment 6 by Raymond Camden posted on 2/26/2009 at 5:15 PM

Try adding some debugging to your Application.cfm file. Ie, log form.version. This will be run before MG does anything.