Twitter: raymondcamden


Address: Lafayette, LA, USA

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

06-02-2006 5,043 views ColdFusion 6 Comments

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

6 Comments

  • Commented on 02-25-2009 at 9:16 PM
    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
  • Commented on 02-25-2009 at 9:39 PM
    Version shouldn't be reserved. Was this with MG3?
  • Commented on 02-25-2009 at 9:47 PM
    I think we have version 2.0.304
  • Commented on 02-25-2009 at 9:49 PM
    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?
  • Commented on 02-25-2009 at 10:43 PM
    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
  • Commented on 02-26-2009 at 6:15 AM
    Try adding some debugging to your Application.cfm file. Ie, log form.version. This will be run before MG does anything.

Post Reply

Please refrain from posting large blocks of code as a comment. Use Pastebin or Gists instead. Text wrapped in asterisks (*) will be bold and text wrapped in underscores (_) will be italicized.

Leave this field empty