You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by "Mark W. Shead" <mw...@gmail.com> on 2008/01/29 07:15:24 UTC
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: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org
RE: T5: Submit Event Handlers
Posted by Adam Ayres <ad...@lithium.com>.
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:mwshead@gmail.com]
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: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org