Note that you have more values to choose from than simply SUBMIT (note, you
can use the value "submit" -- case insensitivity). You may be interested in
only having your method called if the form submits successfully, in which
case you would use the value "success".

You can view the list of event types forms have on the javadoc page:
http://tapestry.apache.org/tapestry5/tapestry-core/apidocs/org/apache/tapestry/corelib/components/Form.html


On 3/16/07, Pablo Ruggia <[EMAIL PROTECTED]> wrote:

You have two choices:

1) Using naming convention:

    public String onSubmitFromMyForm(){
        return "AnotherPage";
    }

Where "Submit" is the event name and "MyForm" is the component id.

2) Using annotations:

    @OnEvent(value="SUBMIT", component="myForm")
    public String onSubmitFromMyForm(){
        return "AnotherPage";
    }


On 3/16/07, Anjana Gopinath <[EMAIL PROTECTED]> wrote:
>
> Hi
>
> How to specify a listener method in T5? I have a page with multiple
> submit buttons and need to navigate to a different page when the user
> clicks on a particular button.
> i tried doing this
>
> @OnEvent(component = "deleteApp")
>         String deleteApp()
>         {
>                 System.out.println("deleteApp");
>                 return "AddService";
>         }
>
> but got an exception
> "This type of event does not support return values from event handler
> methods"
>
> cant find the listener parameter for submit component. Can some one
> please help me out? Thanks!
>
>
> Anjana Gopinath
> True North Technology
> 11465 John's Creek Parkway, Suite 300
> Duluth, GA 30079
> [EMAIL PROTECTED]
>
>
>
>
>
>




--
Peter Beshai

Pure Mathematics/Computer Science Student
University of Waterloo

Reply via email to