Re: T5: Submit Button in Custom Component, Form in Page
If you use the submit component, it will fire a selected event. By handling that, you can detect which button was clicked and act accordingly. HTH, Uli Am 26.11.2009 23:12 schrieb CarmenG: I have a page with a form, nested within the form is a custom component with a select box and a submit button. When the submit button is clicked I want to download either a PDF or Excel file based on the value of the select box. I know the event for the submit button cannot return a value and I don't know how the page's onSuccess event can notify the custom component to download the file, or if it should be done another way. I'm new to Tapestry 5 but have used Tapestry 4 and previously 3 for many years. thanks, Carmen - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
Re: T5: Submit Button in Custom Component, Form in Page
Sorry Uli that doesn't help me as the onSelected event cannot return a value, the download file in my case. Can you elobarate a bit more? What I have read so far have only been examples of Forms and Submit components on the same page/component where you would have private String type; // Value assigned to select component. private String selectedType; public void onSelectedFromDownload() { selectedType = type; } public Object onSuccess() { if (selectedType != null) { return XYZ; // StreamResponse of file for selected type. } } In my case onSelectedFromDownload and onSuccess are in 2 different classes, how do I get onSuccess from the page class to notify the custom component to download the file? The quick and dirty hack that I used was to add selectedType as a parameter of the custom component so the value was available to the custom component and the page, but I really do not like this solution. The custom component should handle the downloading of the file, as it did in Tapestry 4. Any other ideas on what I can do? thanks, Carmen -- View this message in context: http://old.nabble.com/T5%3A-Submit-Button-in-Custom-Component%2C-Form-in-Page-tp26535560p26535821.html Sent from the Tapestry - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
Re: T5: Submit Button in Custom Component, Form in Page
Em Thu, 26 Nov 2009 20:41:59 -0200, CarmenG car...@synect.com escreveu: Sorry Uli that doesn't help me as the onSelected event cannot return a value, the download file in my case. Can you elobarate a bit more? onSelect() cannot, but onSuccess() can return a StreamResponse containing your PDF file. In my case onSelectedFromDownload and onSuccess are in 2 different classes, how do I get onSuccess from the page class to notify the custom component to download the file? They could be in the component class. I can't see why not. I would have a hidden TextField that would have its value copied from your select tag using JavaScript. In this case, all you need is an onSuccess() method in your component that uses the value and then returns the StreamResponse. -- Thiago H. de Paula Figueiredo Independent Java, Apache Tapestry 5 and Hibernate consultant, developer, and instructor Owner, software architect and developer, Ars Machina Tecnologia da Informação Ltda. http://www.arsmachina.com.br - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
Re: T5: Submit Button in Custom Component, Form in Page
Events are passed up the component hierarchy until handled, so just handle the selected event in your page class. Alternatively have your special component fire its own event (use ComponentResources for that) based on what button was clicked and handle that. That's probably the cleaner way to do it. Uli Am 26.11.2009 23:41 schrieb CarmenG: Sorry Uli that doesn't help me as the onSelected event cannot return a value, the download file in my case. Can you elobarate a bit more? What I have read so far have only been examples of Forms and Submit components on the same page/component where you would have private String type; // Value assigned to select component. private String selectedType; public void onSelectedFromDownload() { selectedType = type; } public Object onSuccess() { if (selectedType != null) { return XYZ; // StreamResponse of file for selected type. } } In my case onSelectedFromDownload and onSuccess are in 2 different classes, how do I get onSuccess from the page class to notify the custom component to download the file? The quick and dirty hack that I used was to add selectedType as a parameter of the custom component so the value was available to the custom component and the page, but I really do not like this solution. The custom component should handle the downloading of the file, as it did in Tapestry 4. Any other ideas on what I can do? thanks, Carmen - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
Re: T5:Submit component
Em Tue, 21 Oct 2008 14:38:41 -0300, James Sherwood [EMAIL PROTECTED] escreveu: @OnEvent(component = submitButton) void onSubmitButton() { System.out.println(Submit button was pressed!); } } The Submit components fires the selected event, not the submit event. So your annotation must be @OnEvent(component=submitButton, value=selected) or your method name must be onSelectedButton. You don't need both at the same time. -- Thiago H. de Paula Figueiredo Independent Java consultant, developer, and instructor Consultor, desenvolvedor e instrutor em Java http://www.arsmachina.com.br/thiago - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [T5] Submit does not fire selected event when using disabled property
Works fine here. 2 submit components, one with disabled=true, the other with disabled=false, and the select event from the submit component with disabled=false gets fired just as expected. Maybe you could show us some code so we can try to figure out what's wrong with it. Uli Harald Geritzer schrieb: hi all, im am having some sort of wizard with previous and next submits, which i want to disable depending on the actual step. the strange thing is, if one of the submits has the property disabled set to false it submits the form but does not fire the selected event. anybody else discovered that behavior? ty harald - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [T5] Submit does not fire selected event when using disabled property
sorry, seems to be my fault. i just did not know that first the form submission is processed and afterwards setupRender ist called. i had some intializing logic in my setupRender function which is needed for calculating the submit's disabled state. harald - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: T5: Submit Event Handlers
Try this: @OnEvent(value=selected, component=submitButton) void onSelectedFromSubmitButton() { System.out.println(Submit Button Handler); } //For the form if you wanted to use it... @OnEvent(value=action, component=myForm) void onActionFromMyForm() { System.out.println(Form Action Handler); } You need to explicitly set your if you are using 5.0.7+: https://issues.apache.org/jira/browse/TAPESTRY-1952?page=com.atlassian.j ira.plugin.system.issuetabpanels:all-tabpanel The Tapestry submit component fires a selected event: http://svn.apache.org/viewvc/tapestry/tapestry5/tags/releases/5.0.9/tape stry-core/src/main/java/org/apache/tapestry/corelib/components/Submit.ja va?view=markup Thanks, Adam -Original Message- From: Mark W. Shead [mailto:[EMAIL PROTECTED] Sent: Monday, January 28, 2008 10:15 PM To: users@tapestry.apache.org Subject: T5: Submit Event Handlers I am having problems getting an event handler to fire for a submit button. Here is the relevant part from the .tml form t:type=form t:id=myForm input type=submit value=Submit t:type=submit t:id=submitButton/ /form and here is the handler from the .java file: @OnEvent(component=submitButton) void onSubmitButton() { System.out.println(Submit Button Handler); } Have I overlooked something silly? Mark - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [T5] Submit control event handler cannot redirect?
The error message is clear. This type of event does not support return values from event handler methods. Please take a look at http://wiki.apache.org/tapestry/Tapestry5HowToUseForms Dealing with multiple submits Capter. On 8/8/07, Kolesnikov, Alexander GNI [EMAIL PROTECTED] wrote: I am playing with a simple T5 application that has two pages: Start and Another. The Start page contains the following: p a href=# t:type=ActionLink t:id=actionRedirectDisplay Another page/a /p t:form t:id=theForm input type=submit value=Submit/ t:submit t:id=submitRedirect value=Submit Redirect/ /t:form And here is the page class contents: @InjectPage private Another anotherPage; @OnEvent(value=submit, component=theForm) Object onFormRedirect() { return anotherPage; } @OnEvent(component=actionRedirect) Object onActionRedirect() { return anotherPage; } @OnEvent(component=submitRedirect) Object onSubmitRedirect() { return anotherPage; } So basically the Start page provides three ways to navigate to Another page: by submitting the form (using HTML input type=submit), by clicking on the ActionLink and by by clicking on the Sunmit component. The latter, however, produces exception with the following message: Event 'selected' from Start:submitredirect received an event handler method return value of [EMAIL PROTECTED] from com.packtpub.foundations.pages.Start.onSubmitRedirect() (at Start.java:56). This type of event does not support return values from event handler methods. For me, this looks inconsistent. Okay, Submit control generates 'selected' event, not 'submit', not 'action', but wouldn't it be natural to be able to navigate to another page as a result of a Submit button press? Thanks, Alexander -- CONFIDENTIALITY NOTICE: If you have received this email in error, please immediately notify the sender by e-mail at the address shown. This email transmission may contain confidential information. This information is intended only for the use of the individual(s) or entity to whom it is intended even if addressed incorrectly. Please delete it from your files if you are not the intended recipient. Thank you for your compliance. Copyright 2007 CIGNA == -- Regards Denny Site: http://dengyin2000.javaeye.com
RE: [T5] Submit control event handler cannot redirect?
Thank you, Denny. Yes, I understand that it is done like this, but I am actually trying to discuss the consistence of the framework design. Is there any specific reason that 'select' event handler works differently from any other event handler? If yes, then why Submit component generates exactly 'select' event? What exactly we are selecting when pressing a Submit button? Why its event is not 'action'? -Original Message- From: Denny [mailto:[EMAIL PROTECTED] Sent: 08 August 2007 10:06 To: Tapestry users Subject: Re: [T5] Submit control event handler cannot redirect? The error message is clear. This type of event does not support return values from event handler methods. Please take a look at http://wiki.apache.org/tapestry/Tapestry5HowToUseForms Dealing with multiple submits Capter. On 8/8/07, Kolesnikov, Alexander GNI [EMAIL PROTECTED] wrote: I am playing with a simple T5 application that has two pages: Start and Another. The Start page contains the following: p a href=# t:type=ActionLink t:id=actionRedirectDisplay Another page/a /p t:form t:id=theForm input type=submit value=Submit/ t:submit t:id=submitRedirect value=Submit Redirect/ /t:form And here is the page class contents: @InjectPage private Another anotherPage; @OnEvent(value=submit, component=theForm) Object onFormRedirect() { return anotherPage; } @OnEvent(component=actionRedirect) Object onActionRedirect() { return anotherPage; } @OnEvent(component=submitRedirect) Object onSubmitRedirect() { return anotherPage; } So basically the Start page provides three ways to navigate to Another page: by submitting the form (using HTML input type=submit), by clicking on the ActionLink and by by clicking on the Sunmit component. The latter, however, produces exception with the following message: Event 'selected' from Start:submitredirect received an event handler method return value of [EMAIL PROTECTED] from com.packtpub.foundations.pages.Start.onSubmitRedirect() (at Start.java:56). This type of event does not support return values from event handler methods. For me, this looks inconsistent. Okay, Submit control generates 'selected' event, not 'submit', not 'action', but wouldn't it be natural to be able to navigate to another page as a result of a Submit button press? Thanks, Alexander -- CONFIDENTIALITY NOTICE: If you have received this email in error, please immediately notify the sender by e-mail at the address shown. This email transmission may contain confidential information. This information is intended only for the use of the individual(s) or entity to whom it is intended even if addressed incorrectly. Please delete it from your files if you are not the intended recipient. Thank you for your compliance. Copyright 2007 CIGNA == -- Regards Denny Site: http://dengyin2000.javaeye.com -- CONFIDENTIALITY NOTICE: If you have received this email in error, please immediately notify the sender by e-mail at the address shown. This email transmission may contain confidential information. This information is intended only for the use of the individual(s) or entity to whom it is intended even if addressed incorrectly. Please delete it from your files if you are not the intended recipient. Thank you for your compliance. Copyright 2007 CIGNA == - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: [T5] Submit control event handler cannot redirect?
Thank you very much, Nick! -Original Message- From: Nick Westgate [mailto:[EMAIL PROTECTED] Sent: 08 August 2007 10:21 To: Tapestry users Subject: Re: [T5] Submit control event handler cannot redirect? Think of it this way: the answer is no if you supply t:defer=false, because then the redirect would occur before the form completed rewinding. That would be kind of like an exception. ;-) http://wiki.apache.org/tapestry/Tapestry5RedirectException I agree with you that's it's inconsistent though, and could be changed. The event framework is definitely alpha, IHMO, with all the cool features already implemented but some deeper issues yet to be resolved. (In fact I'm about to post a JIRA improvement issue related to events.) Cheers, Nick. Kolesnikov, Alexander GNI wrote: For me, this looks inconsistent. Okay, Submit control generates 'selected' event, not 'submit', not 'action', but wouldn't it be natural to be able to navigate to another page as a result of a Submit button press? Thanks, Alexander -- CONFIDENTIALITY NOTICE: If you have received this email in error, please immediately notify the sender by e-mail at the address shown. This email transmission may contain confidential information. This information is intended only for the use of the individual(s) or entity to whom it is intended even if addressed incorrectly. Please delete it from your files if you are not the intended recipient. Thank you for your compliance. Copyright 2007 CIGNA == - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- CONFIDENTIALITY NOTICE: If you have received this email in error, please immediately notify the sender by e-mail at the address shown. This email transmission may contain confidential information. This information is intended only for the use of the individual(s) or entity to whom it is intended even if addressed incorrectly. Please delete it from your files if you are not the intended recipient. Thank you for your compliance. Copyright 2007 CIGNA == - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [T5] Submit control event handler cannot redirect?
The natural flow of form submission is to update internal state with posted values from the form and then render the result page. Whether that is the same page (which is often the case) or not is usually decided at the end of the form processing. So the select events simply notify us of which submit was selected (Save? Cancel?) and perhaps alter the final outcome depending on validation etc. (Again, IMHO. ;-) Cheers, Nick. Kolesnikov, Alexander GNI wrote: Yes, I understand that it is done like this, but I am actually trying to discuss the consistence of the framework design. Is there any specific reason that 'select' event handler works differently from any other event handler? If yes, then why Submit component generates exactly 'select' event? What exactly we are selecting when pressing a Submit button? Why its event is not 'action'? - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: [T5] Submit control event handler cannot redirect?
I see, Nick. Things are much simpler with ActionLink because it isn't a form component. Thanks a lot! Alex -Original Message- From: Nick Westgate [mailto:[EMAIL PROTECTED] Sent: 08 August 2007 10:44 To: Tapestry users Subject: Re: [T5] Submit control event handler cannot redirect? The natural flow of form submission is to update internal state with posted values from the form and then render the result page. Whether that is the same page (which is often the case) or not is usually decided at the end of the form processing. So the select events simply notify us of which submit was selected (Save? Cancel?) and perhaps alter the final outcome depending on validation etc. (Again, IMHO. ;-) Cheers, Nick. Kolesnikov, Alexander GNI wrote: Yes, I understand that it is done like this, but I am actually trying to discuss the consistence of the framework design. Is there any specific reason that 'select' event handler works differently from any other event handler? If yes, then why Submit component generates exactly 'select' event? What exactly we are selecting when pressing a Submit button? Why its event is not 'action'? - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- CONFIDENTIALITY NOTICE: If you have received this email in error, please immediately notify the sender by e-mail at the address shown. This email transmission may contain confidential information. This information is intended only for the use of the individual(s) or entity to whom it is intended even if addressed incorrectly. Please delete it from your files if you are not the intended recipient. Thank you for your compliance. Copyright 2007 CIGNA == - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [T5] Submit component doesn't render the label?
okay, i'll do that. Just thought it was a little weird that the component accepted a formal parameter that is never used. On Thu, 2007-06-21 at 07:35 -0700, Howard Lewis Ship wrote: I suppose it could; I've been trying to minimize what T5 does in this area, i.e., ou should bind the (informal) value parameter (which is what is used as the label). On 6/21/07, Dan Adams [EMAIL PROTECTED] wrote: I have the following: t:submit t:id=formSubmit class=button label=prop:buttonLabel / which results in: input class=button id=formSubmit name=formSubmit type=submit The component has this which looks like it never uses the label parameter: void beginRender(MarkupWriter writer) { writer.element(input, type, submit, name, getElementName(), id, getClientId()); } -- Dan Adams Senior Software Engineer Interactive Factory 617.235.5857 - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- Dan Adams Senior Software Engineer Interactive Factory 617.235.5857 - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [T5] Submit component doesn't render the label?
The label parameter is implicit in thethe Field interface, you could also put a label on a Submit (not sure why). It's possible that Submit should not be a Field, but simply be Field-like. On 6/22/07, Dan Adams [EMAIL PROTECTED] wrote: okay, i'll do that. Just thought it was a little weird that the component accepted a formal parameter that is never used. On Thu, 2007-06-21 at 07:35 -0700, Howard Lewis Ship wrote: I suppose it could; I've been trying to minimize what T5 does in this area, i.e., ou should bind the (informal) value parameter (which is what is used as the label). On 6/21/07, Dan Adams [EMAIL PROTECTED] wrote: I have the following: t:submit t:id=formSubmit class=button label=prop:buttonLabel / which results in: input class=button id=formSubmit name=formSubmit type=submit The component has this which looks like it never uses the label parameter: void beginRender(MarkupWriter writer) { writer.element(input, type, submit, name, getElementName(), id, getClientId()); } -- Dan Adams Senior Software Engineer Interactive Factory 617.235.5857 - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- Dan Adams Senior Software Engineer Interactive Factory 617.235.5857 - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- Howard M. Lewis Ship TWD Consulting, Inc. Independent J2EE / Open-Source Java Consultant Creator and PMC Chair, Apache Tapestry Creator, Apache HiveMind Professional Tapestry training, mentoring, support and project work. http://howardlewisship.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [T5] Submit component doesn't render the label?
I suppose it could; I've been trying to minimize what T5 does in this area, i.e., ou should bind the (informal) value parameter (which is what is used as the label). On 6/21/07, Dan Adams [EMAIL PROTECTED] wrote: I have the following: t:submit t:id=formSubmit class=button label=prop:buttonLabel / which results in: input class=button id=formSubmit name=formSubmit type=submit The component has this which looks like it never uses the label parameter: void beginRender(MarkupWriter writer) { writer.element(input, type, submit, name, getElementName(), id, getClientId()); } -- Dan Adams Senior Software Engineer Interactive Factory 617.235.5857 - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- Howard M. Lewis Ship TWD Consulting, Inc. Independent J2EE / Open-Source Java Consultant Creator and PMC Chair, Apache Tapestry Creator, Apache HiveMind Professional Tapestry training, mentoring, support and project work. http://howardlewisship.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: T5 submit
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.handleResult( 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
Re: T5 submit
onSelectFromLogin() { ... } onSelectFromHelp() { ... } Store a value in these event handler methods. Return that value from onSubmitFromForm(). Submit components should be related to the Form and the data editted by the Form, so they are not allowed to abort the processing of the Form early. If you want true navigation, then use PageLink or ActionLink (you can use CSS to style the buttons like a traditional submit button). On 3/19/07, Anjana Gopinath [EMAIL PROTECTED] wrote: 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.handleResult( 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
Re: T5 submit
Thanks a lot for helping me out, howard. It works now. Anjana Gopinath True North Technology 11465 John's Creek Parkway, Suite 300 Duluth, GA 30079 [EMAIL PROTECTED] On Mar 19, 2007, at 10:22 AM, Howard Lewis Ship wrote: onSelectFromLogin() { ... } onSelectFromHelp() { ... } Store a value in these event handler methods. Return that value from onSubmitFromForm(). Submit components should be related to the Form and the data editted by the Form, so they are not allowed to abort the processing of the Form early. If you want true navigation, then use PageLink or ActionLink (you can use CSS to style the buttons like a traditional submit button). On 3/19/07, Anjana Gopinath [EMAIL PROTECTED] wrote: 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()
Re: T5 submit
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]
Re: T5 submit
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
Re: T5 submit
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
Re: T5 submit
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
Re: T5 submit
Pabloi have attached a simple html and page class.Thanks a lot for looking into this. AddService.java Description: Binary data Anjana GopinathTrue North Technology11465 John's Creek Parkway, Suite 300Duluth, 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 PabloI tried giving both options suggested by Pabloinput 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 workThanksAnjana GopinathTrue North Technology11465 John's Creek Parkway, Suite 300Duluth, 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
Re: T5 submit
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