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.

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.

--
Ezra Parker


On Fri, Nov 20, 2009 at 8:18 PM, Bob Silverberg
<[email protected]> wrote:
> Simple example: A reset password form. If a matching email address is found
> it redirects, via a result, to an event which displays a confirmation
> message. If a matching email address is not found, it redisplays the form,
> also via a result.  When that form is redisplayed, it seems to me that the
> simplest logic to use to determine whether to display an error message to
> the user would be to check whether the result that caused the form to be
> redisplayed was added to the event.  But it doesn't seem like that info is
> available. If I check event.getResults() I get an empty array, so I'm
> assuming that the results are being cleared prior to displaying the form.
> I know I have other options, such as:
> 1. Set a value into the event to indicate that no matching email address was
> found.
> 2. Just check for the existence of the EmailAddress value in the event, as
> it will only be present if the form was already submitted.
> My feeling is that by adding a result to the event, I'm already providing
> the metadata that I need to make the determination, so why should I have to
> do #1, and I feel like #2 is indirect.
> I am fully prepared to be proven absolutely wrong about this, as is often
> the case when it comes to me and Model-Glue.
> Cheers,
> Bob
>
> --
> 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

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