Re: T5: Submit Button in Custom Component, Form in Page

2009-11-26 Thread Ulrich Stärk
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

Re: T5: Submit Button in Custom Component, Form in Page

2009-11-26 Thread Thiago H. de Paula Figueiredo
Em Thu, 26 Nov 2009 20:41:59 -0200, CarmenG 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 c

Re: T5: Submit Button in Custom Component, Form in Page

2009-11-26 Thread 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;

Re: T5: Submit Button in Custom Component, Form in Page

2009-11-26 Thread Ulrich Stärk
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 b

Re: T5:Submit component

2008-10-21 Thread Thiago H. de Paula Figueiredo
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" even

Re: [T5] Submit does not fire selected event when using disabled property

2008-09-27 Thread Harald Geritzer
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

Re: [T5] Submit does not fire selected event when using disabled property

2008-09-27 Thread Ulrich Stärk
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 Ger

RE: T5: Submit Event Handlers

2008-01-29 Thread Adam Ayres
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("F

RE: [T5] Submit control event handler cannot redirect?

2007-08-08 Thread Kolesnikov, Alexander GNI
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 red

Re: [T5] Submit control event handler cannot redirect?

2007-08-08 Thread Nick Westgate
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 sub

RE: [T5] Submit control event handler cannot redirect?

2007-08-08 Thread Kolesnikov, Alexander GNI
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

RE: [T5] Submit control event handler cannot redirect?

2007-08-08 Thread Kolesnikov, Alexander GNI
es 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 handle

Re: [T5] Submit control event handler cannot redirect?

2007-08-08 Thread Nick Westgate
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 tho

Re: [T5] Submit control event handler cannot redirect?

2007-08-08 Thread Denny
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 p

Re: [T5] Submit component doesn't render the label?

2007-06-22 Thread Howard Lewis Ship
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 th

Re: [T5] Submit component doesn't render the label?

2007-06-22 Thread Dan Adams
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)

Re: [T5] Submit component doesn't render the label?

2007-06-21 Thread Howard Lewis Ship
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: which results in: The component has this which looks

Re: T5 submit

2007-03-19 Thread Anjana Gopinath
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 val

Re: T5 submit

2007-03-19 Thread Howard Lewis Ship
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. I

Re: T5 submit

2007-03-19 Thread Anjana Gopinath
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 valu

Re: T5 submit

2007-03-16 Thread Pablo Ruggia
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 t

Re: T5 submit

2007-03-16 Thread Anjana Gopinath
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

Re: T5 submit

2007-03-16 Thread Pablo Ruggia
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 @OnEvent(value = "submit",component="addApps") void addApps(){ System.out.println("---

Re: T5 submit

2007-03-16 Thread Anjana Gopinath
Thanks Peter and Pablo I tried giving both options suggested by Pablo @OnEvent(value = "submit",component="addApps") void addApps(){ System.out.println("---here "); // return "viewSummary"; } This is not getting invoked at all!.

Re: T5 submit

2007-03-16 Thread Peter Beshai
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

Re: T5 submit

2007-03-16 Thread Pablo Ruggia
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 onSubmitFromMyFo