It doesn't.  It gets called 5 times. ;)

the "validate" event is fired by each form field and also by the form.  You 
have four form fields (four selects) + the form. 4+1=5, so the behavior is 
expected.

You can make the event handler more specific:

onValidateFromForm

would only be called 1x, to validate the form.

onValidateFromChairman

would only be called 1x, to validate the chairman select.  Rinse, repeat.

Robert

On Jul 28, 2011, at 7/281:26 AM , Gunnar Eketrapp wrote:

> Hi!
> 
> Maybe a newbie question but I have been on vacation for a month.
> 
> Why does onValidate get's called four times when I submit form below.
> 
> Thank's in advance!
> 
> /Gunnar Eketrapp
> 
> Form looks like ...
> 
> <t:form t:id="form">
>    <fieldset>
> 
>    <label for="member" class="span-4">Mötesordförande:</label>
>    <t:select name="chairman" t:id="chairman" value="meeting.chairman"
> model="memberModel" encoder="memberEncoder" />
>    <br/>
> 
>    <label for="member" class="span-4">Sekreterare:</label>
>    <t:select name="secretary" t:id="secretary" value="meeting.secretary"
> model="memberModel" encoder="memberEncoder" />
>    <br/>
> 
>    <label for="member" class="span-4">Justerare:</label>
>    <t:select name="justifier" t:id="justifier" value="meeting.justifier"
> model="memberModel" encoder="memberEncoder" />
>    <br/>
> 
>    <label for="member" class="span-4">Justerare:</label>
>    <t:select name="justifier2" t:id="justifier2" value="meeting.justifier2"
> model="memberModel" encoder="memberEncoder" />
>    <br/>
> 
>    </fieldset>
> 
>    <p>
>    <t:submit t:id="save" value="Save" />
>    </p>
> </t:form>
> 
> ====================================================================
> 
> And log looks like ...
> 
> 2011-07-28 08:08:57.666 [btpool0-29] DEBUG
> u.pages.meeting.MeetingParticipants - [ENTER] onActivate(2, 19)
> 2011-07-28 08:08:57.900 [btpool0-29] DEBUG
> u.pages.meeting.MeetingParticipants - [ EXIT] onActivate [null]
> 2011-07-28 08:08:57.903 [btpool0-29] DEBUG
> u.pages.meeting.MeetingParticipants - [ENTER] onValidate()
> 2011-07-28 08:08:57.903 [btpool0-29] DEBUG
> u.pages.meeting.MeetingParticipants - [ EXIT] onValidate [null]
> 2011-07-28 08:08:57.903 [btpool0-29] DEBUG
> u.pages.meeting.MeetingParticipants - [ENTER] onValidate()
> 2011-07-28 08:08:57.903 [btpool0-29] DEBUG
> u.pages.meeting.MeetingParticipants - [ EXIT] onValidate [null]
> 2011-07-28 08:08:57.903 [btpool0-29] DEBUG
> u.pages.meeting.MeetingParticipants - [ENTER] onValidate()
> 2011-07-28 08:08:57.904 [btpool0-29] DEBUG
> u.pages.meeting.MeetingParticipants - [ EXIT] onValidate [null]
> 2011-07-28 08:08:57.904 [btpool0-29] DEBUG
> u.pages.meeting.MeetingParticipants - [ENTER] onValidate()
> 2011-07-28 08:08:57.904 [btpool0-29] DEBUG
> u.pages.meeting.MeetingParticipants - [ EXIT] onValidate [null]
> 2011-07-28 08:08:57.906 [btpool0-29] DEBUG
> u.pages.meeting.MeetingParticipants - [ENTER] onValidate()
> 2011-07-28 08:08:57.906 [btpool0-29] DEBUG
> u.pages.meeting.MeetingParticipants - [ EXIT] onValidate [null]
> 2011-07-28 08:08:57.907 [btpool0-29] DEBUG
> u.pages.meeting.MeetingParticipants - [ENTER] onSuccessFromForm()
> 2011-07-28 08:08:57.907 [btpool0-29] DEBUG
> u.pages.meeting.MeetingParticipants - [ EXIT] onSuccessFromForm [null]


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

Reply via email to