Hi Martin,

The onSelected even happens after the form fields have been submitted, my
need is to edit a Hibernate bean, what I'm doing now is: I persisted the
bean's id, in the onActivate even I re-read the bean, so that form will
update an existing bean, however, even the cancel button triggers onActivate
event as well. so moving the re-reading of bean to onSelectedFromUpdate
seems a solution, but it's too late at that time as form has been submitted,
any idea ? Thanks,

A.C.
p.s. will be better if we can have an event before the form is submitted,
that is onActivate, but we have no way to determine which button triggers
the event there.


Martin Kersten-2 wrote:
> 
> Hi A.C.
> 
>    I asked the very same question before but in conjunction 
> with normal t:form component. Since the bean-editor is based on
> that t:form component it should apply to this scenario as well:
> 
> Rule of Thumb: If you have a button you have an onSelected event!
> 
> So in your case:
> 
> <t:form>
>  <input t:type="submit" t:id="done" value="Done"/>
>  <input t:type="submit" t:id="failed" value="Failed"/>
> </t:form>
> 
> class MyPage {
>    final int DONE = 0;
>    final int FAILED = 1;
> 
>    int submitType = DONE;
> 
>    boolean onSelectedFromDone() {
>       submitType = DONE;
>       return true;
>    }
> 
> 
> 

-- 
View this message in context: 
http://www.nabble.com/T5%3A-determine-button-clicked-in-a-beaneditor-tp15841944p15846642.html
Sent from the Tapestry - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to