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
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
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;
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
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
Hello,
I am playing around with T5 and I have a submit inside of a form component
like this:
TML:
input type=submit t:type=submit t:id=submitButton value=Submit/
Java:
@OnEvent(component = submitButton)
void onSubmitButton() {
System.out.println(Submit button was
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
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
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
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
/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
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:
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
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
'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
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
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
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
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)
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
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)
{
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
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
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.
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
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()
{
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(){
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
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
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)
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
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
32 matches
Mail list logo