Hi Allen,
You can use
public void onSelectedFromUpdate(){...}
public void onSelectedFromBack(){...}
A couple of things to note:
- all the standard form events (prepare, submit, validate, etc) will also
be invoked.
I believe that selected events will be invoked between prepare and
validate
- onSelected methods must return void, so you can't do navigation from
them.
If you want to navigate based on the submit button you need to set a
flag/enum in the
onSelected method & return a page based on that from
onSuccess/onSubmit/etc
cheers
Ben
> -----Original Message-----
> From: Allen Guo [mailto:[EMAIL PROTECTED]
> Sent: Tuesday, 29 May 2007 12:33 PM
> To: Tapestry users
> Subject: Trigger different behavior by clicking the different
> button in Tapestry5.0.4
>
> Hi All,
>
> There are two submit button on html template below.
> ....
> <input type="submit" t:id="update" value="UPDATE"/>
> <input type="submit" t:id="back" value="BACK"/>
> ....
>
> I would like to trigger a defferent method in Page class when clicking
> each button. So the page class looks like
> .....
> public void onUpdate(){....}
> public void onBack(){.....}
> ....
> You know, if the action is just ActionLink or PageLink, I
> know how I can
> do it.
> But for button type is 'submit', what should I do?
>
> Thanks in advanced
> Allen Guo
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]