a solution is documented on the wiki page:
http://wiki.apache.org/tapestry/Tapestry5HowToUseForms
look for "Dealing with multiple submits"


Mike Leonardo wrote:
> 
> Hello,
> I have a form that uses the zone parameter so that the submission is
> handled as an Ajax reload.
> The problem is that my form has two submit buttons, but Tapestry seems to
> always trigger the "selected" event for the first button, regardless of
> which one I click. 
> 
> I've created this small test page to prove it to myself:
> 
> MyTestPage.tml
> ----------
> <t:zone id="testZone">
> <t:form zone="testZone">
> Value: ${value}
> <t:textfield value="value" />
> <input type="submit" t:type="submit" t:id="firstButton" value="Submit" />
> <input type="submit" t:type="submit" t:id="secondButton" value="Submit2"
> />
> </t:form>
> </t:zone>
> 
> 
> MyTestPage.java
> -----------
> public class MyTestPage {
>       @Property private int value;
>       @InjectComponent private Form form;
>       
>       void onSelectedFromFirstButton() {
>               System.out.println("Reached First Button");
>       }
>       
>       void onSelectedFromSecondButton() {
>               System.out.println("Reached Second Button");
>       }
> }
> 
> Only my method "OnSelectedFromFirstButton" is visited, never the
> "OnSelectedFromSecondButton".
> I also tried an onchange javascript event to just submit the form (i.e.
> not pushing any buttons) and it still triggers the first button event.
> Is this is a bug, or do I not understand how this works?
> 
> Thanks for any help!
> - Mike
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
> 
> 

-- 
View this message in context: 
http://www.nabble.com/T5%3A-Form-using-Zone-with-two-submits---possible-bug--tp18898971p18902318.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