Pablo,
Thanks a lot for helping me. I tried the options you suggested. It
looks like OnEvent(value="selected", ---) doesnt take a return type.
i get the exception given below.
Event 'selected' from com.truenorth.quote.pages.AddService:addapps
received an event handler method return value of Start from
com.truenorth.quote.pages.AddService.addApps() (at AddService.java:
10). This type of event does not support return values from event
handler methods.
at
org.apache.tapestry.internal.util.NotificationEventHandler.handleResu
lt(
NotificationEventHandler.java:42)
It works well if the return type is void. I also tried the second
option,
@OnEvent(value = "submit",component="form")
String addApps(){
System.out.println("-----------here ");
return "Start";
}
This takes me to the next page, but i have multiple submit buttons on
the same page. So any submit button i hit, this method is called.
What i am trying to achieve is some thing similar to the listener
methods in tapestry 4. This is what i used to do in T 4.
<input type="submit" wcid="[EMAIL PROTECTED]" action="listener:doLogin"
value="Login"/>
<input type="submit" jwcid="[EMAIL PROTECTED]" action="listener:doHelp"
value="Help"/>
Anjana Gopinath
True North Technology
11465 John's Creek Parkway, Suite 300
Duluth, GA 30079
[EMAIL PROTECTED]
On Mar 16, 2007, at 11:30 PM, Pablo Ruggia wrote:
> The Form fire this this events: "submit", "success", "prepare",
> "validate"
> and "failure".
> The Submit component only fires "selected" event.
>
> So, if you use the form component, you have to use "submit" or
> "success"
> events.
> If you are listening to the button, then use "selected" event. So
> you have
> to put something like this:
>
> @OnEvent(value = "selected",component="addApps")
> void addApps(){
> System.out.println("-----------here ");
> // return "viewSummary";
> }
>
> On 3/16/07, Anjana Gopinath <[EMAIL PROTECTED]> wrote:
>>
>> Pablo
>> i have attached a simple html and page class.
>>
>> Thanks a lot for looking into this.
>>
>>
>>
>>
>>
>> Anjana Gopinath
>> True North Technology
>> 11465 John's Creek Parkway, Suite 300
>> Duluth, GA 30079
>> [EMAIL PROTECTED]
>>
>>
>>
>>
>>
>> On Mar 16, 2007, at 4:01 PM, Pablo Ruggia wrote:
>>
>> Can you send us your page template and class ?
>>
>> On 3/16/07, Anjana Gopinath <[EMAIL PROTECTED]> wrote:
>>
>>
>> Thanks Peter and Pablo
>>
>> I tried giving both options suggested by Pablo
>>
>> <input t:type="Submit" value="Select applications"
t:id="addApps" />
>>
>>
>> @OnEvent(value = "submit",component="addApps")
>> void addApps(){
>> System.out.println("-----------here ");
>> // return "viewSummary";
>> }
>>
>> This is not getting invoked at all!. if i just give onEvent
>> (component="addApps") , it is invoked , but wont take a
returntype.
>>
>>
>> Also tried
>>
>> public String onSubmitFromAddApps()
>> {
>> return "ViewSummary";
>>
>> }
>>
>> That too didnt work
>>
>> Thanks
>>
>> Anjana Gopinath
>> True North Technology
>> 11465 John's Creek Parkway, Suite 300
>> Duluth, GA 30079
>> [EMAIL PROTECTED]
>>
>>
>>
>>
>>
>> On Mar 16, 2007, at 2:19 PM, Peter Beshai wrote:
>>
>> > 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
>>
>>
>>
>>
>>
>>