Re: More than one submit button in one form.

2009-02-27 Thread Thiago H. de Paula Figueiredo

Em Fri, 27 Feb 2009 12:45:27 -0300, 孙立伟  escreveu:


Yes, the onSelectedXXX works! Thank you. The annotaded way won't work.
I've tried it. Maybe this is a bug. I am using Tapestry 5.0.18.


The annotated does not work because it is wrong. You need to specify the  
event name (@OnEvent(value="selected")), otherwise Tapestry thinks you  
want the "action" event.


--
Thiago H. de Paula Figueiredo
Independent Java consultant, developer, and instructor
http://www.arsmachina.com.br/thiago

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



Re: More than one submit button in one form.

2009-02-27 Thread 孙立伟
Yes, the onSelectedXXX works! Thank you. The annotaded way won't work.
I've tried it. Maybe this is a bug. I am using Tapestry 5.0.18.

2009/2/27 nille hammer :
> Hi Dante,
> the convention for naming of handle methods of submit events is 
> "onSelectedFrom". Rewrite your code as follows and it shuld work. The 
> annotaded way should work too, although I have never used it myself.
>
> public class Start{
> void onSelectedFromBtnA(){
> // this should work
> }
>
> void onSelectedFromBtnB(){
> //this should work
> }
> See documentation of the Submit component for further details: 
> http://tapestry.apache.org/tapestry5/tapestry-core/ref/org/apache/tapestry5/corelib/components/Submit.html
>
> Kind Regards, nillehammer
>
> --
> http://www.winfonet.eu
>
> - original Nachricht 
>
> Betreff: More than one submit button in one form.
> Gesendet: Fr, 27. Feb 2009
> Von: ËïÁ¢Î°
>
>> 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:
>>
>> 
>>     
>>     
>> 
>>
>>
>> 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
>>
>>
>
> --- original Nachricht Ende 
>
>
> -
> To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
> For additional commands, e-mail: users-h...@tapestry.apache.org
>
>

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



Re: More than one submit button in one form.

2009-02-27 Thread nille hammer
Hi Dante,
the convention for naming of handle methods of submit events is 
"onSelectedFrom". Rewrite your code as follows and it shuld work. The 
annotaded way should work too, although I have never used it myself.

public class Start{
void onSelectedFromBtnA(){
// this should work
}

void onSelectedFromBtnB(){
//this should work
}
See documentation of the Submit component for further details: 
http://tapestry.apache.org/tapestry5/tapestry-core/ref/org/apache/tapestry5/corelib/components/Submit.html

Kind Regards, nillehammer

--
http://www.winfonet.eu

- original Nachricht 

Betreff: More than one submit button in one form.
Gesendet: Fr, 27. Feb 2009
Von: ËïÁ¢Î°

> 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:
> 
> 
> 
> 
> 
> 
> 
> 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
> 
> 

--- original Nachricht Ende 


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