i'm not surprised, because this has bitten me in the past as well. If you
look at the hints for EventContext.getValue the default argument clearly
says "I am a default value to *set* and return if the value does not exist."
Now as to whether this behaviour is desirable or not...

If only ModelGlue used some kind of configurable transient factory to create
things like MapCollection rather than createobject calls then you could
provide your own Collection that didn't follow this behaviour, in the same
way you can provide your own UrlManager via coldspring


2009/10/22 Sean Corfield <[email protected]>

>
> On Wed, Oct 21, 2009 at 11:09 PM, David Mineer <[email protected]> wrote:
> > Both reports return 55 rows.  The first value put into the argument seems
> to
> > stick.
>
> In my opinion this is a bug in MG and it's bitten me a few times. I do
> not think that specifying a default for a specific call should affect
> the underlying data. If I do not have "foo" in the event, the
> following code should assign the defaults I specify in each call - not
> the first default and then ignore the second default:
>
> <cfset foo1 = event.getValue("foo","my first default") />
> <cfset foo2 = event.getValue("foo",42) />
>
> The fact that foo2 is not 42 ought to surprise everyone.
> --
> Sean A Corfield -- (904) 302-SEAN
> Railo Technologies US -- http://getrailo.com/
> An Architect's View -- http://corfield.org/
>
> "If you're not annoying somebody, you're not really alive."
> -- Margaret Atwood
>
> >
>

--~--~---------~--~----~------------~-------~--~----~
Model-Glue Sites:
Home Page: http://www.model-glue.com
Documentation: http://docs.model-glue.com
Bug Tracker: http://bugs.model-glue.com
Blog: http://www.model-glue.com/blog

You received this message because you are subscribed to the Google
Groups "model-glue" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/model-glue?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to