Components fire validate events as well as the form, so modify your
@OnEvent to identify the form as the origin of the event.

On Fri, Oct 15, 2010 at 9:31 AM, Blower, Andy
<andy.blo...@proquest.co.uk> wrote:
> From one of my developers:
>
> When using the VALIDATE event to validate form details, the validation method 
> is called several times.
>
> Eg.
>
>       �...@onevent(EventConstants.VALIDATE)
>        void validateChooseFolderForm() {
>
>                ...
>        }
>
> Is called at least three times, executing different sections of the code each 
> time. Each time it is called, the test values show as null in Eclipse debug 
> mode, though I suspect it is being run once per field in the form. The third 
> time it is run, a NullPointerException is thrown by the "else if 
> (!isFolderNameUnique())" line.
>
> Workaround is to change to @OnEvent(EventConstants.VALIDATE_FORM). This only 
> calls the validate method once per submission.
>
>
> This seems to have affected us in two places when deprecated events were 
> updated to the new version. Is this a known issue?
>
> Thanks,
>
> Andy
>



-- 
Howard M. Lewis Ship

Creator of Apache Tapestry

The source for Tapestry training, mentoring and support. Contact me to
learn how I can get you up and productive in Tapestry fast!

(971) 678-5210
http://howardlewisship.com

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
For additional commands, e-mail: users-h...@tapestry.apache.org

Reply via email to