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
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
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;
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
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
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
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
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
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
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
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
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
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
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
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
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)
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
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
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
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
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
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 Pablo
I tried giving both options suggested by Pablo
@OnEvent(value = "submit",component="addApps")
void addApps(){
System.out.println("---
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!.
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
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
26 matches
Mail list logo