Responses to two emails inline below:
On Fri, Nov 20, 2009 at 11:58 PM, Ezra Parker <[email protected]> wrote:
> The results are indeed cleared as one of the last steps in executing
> an event handler. If this was not done, the potential problem that
> occurs to me is the possibility that results might unexpectedly be
> fired in the target event handler if they happened to have the same
> name as any of the results that were added by previous event-handlers.
>
>
Ah yes, that makes sense.
>
> I see your point that a bit of duplication or indirection is necessary
> to accomplish this task, but my feeling would be that changing the
> behavior to avoid clearing out the results is likely to cause problems
> in some applications.
>
>
Right, but maybe, and this is just a Bob-Crazy-Idea-Maybe, what if, in
addition to storing the result in _variables.results in the EventContext
from whence it's used for processing results, it was also added to a
"reporting array" of results in the event as well? So I wouldn't call
getResults() to find out what results have been added to an event, rather I
could call event.getValue("addedResults") which would return an array of any
and all results that had been added? And/or perhaps a resultAdded() method
that accepts a result name as an argument and returns a boolean.
These would be simple changes that would not affect backward compatibility,
but of course if nobody else sees value in this there's no point to adding
them. Considering that this is not something that already exists in the
framework, I'm guessing there's a reason for that, but I'm not sure what it
is.
On Sat, Nov 21, 2009 at 6:42 AM, Chris Blackwell <[email protected]> wrote:
> maybe i'm missing something, but I just have my controller set an error
> message into the event before adding my "EmailNotFound" result. Then my
> password reminder form can simply check if there's an error message to
> display.
>
>
That is another approach that would work, but I'd prefer to keep any display
specific code out of my controller, and keep it encapsulated in my view. I
don't want to have to edit a controller to change an error message. So that
really leads me back to option 1, which is similar to what you suggest, but
rather than setting an error message in the controller, I'd just be setting
a value into the event which I would then check in my view.
Again, as this "result checking" mechanism does not currently exist, are
there any other ways that people are dealing with this?
--
Bob Silverberg
www.silverwareconsulting.com
--
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