While I am reading the book "Tapestry 5: Building Web Applications",
it introduces a way to implements two submit button in one form(see
the code below). But  according to
http://markmail.org/message/fjev6gt76fpc6akq , all buttons' events
will be "overrided" by the form component. Is there a way to detect
which button is clicked?

For example, how to let the following code work?

Start.tml:

<t:form t:id="mainForm">
    <input type="submit" t:type="submit" t:id="btnA"/>
    <input type="submit" t:type="submit" t:id="btnB"/>
</t:form>


Start.java
public class Start{
@OnEvent(component="btnA")
void onBtnAClick(){
// this won't work
}

@OnEvent(component="btnB")
void onBtnBClick(){
//this won't work
}

@OnEvent(component="mainForm")
Object onFormSubmit(){
  //only this works
}
}

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

Reply via email to