EventListener does not allow use of versions of methods with BrowserEvent and
RequestCyle parameters
----------------------------------------------------------------------------------------------------
Key: TAPESTRY-1051
URL: http://issues.apache.org/jira/browse/TAPESTRY-1051
Project: Tapestry
Issue Type: Bug
Components: Annotations
Affects Versions: 4.1, 4.1.1
Environment: XP
Tomcat 5.0.1.9
Java 1.5.0_01
Tapestry 4.1 or 4.1.1 snapshot
Reporter: Dom Couldwell
I've split this down into a very simple example:
TestEventListener.hml:
<html jwcid="@Shell" title="Tes Event Listener">
<body jwcid="@Body">
<form jwcid="[EMAIL PROTECTED]">
<div>
<input id="test" type="button" value="Hi"/>
</div>
<div>
<span jwcid="[EMAIL PROTECTED]"
value="ognl:clicked"
id="refreshme"
class=""/>
</div>
</form>
</body>
</html>
TestEventListener.java
package com.db.rdq.web.page;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.apache.tapestry.IExternalPage;
import org.apache.tapestry.IRequestCycle;
import org.apache.tapestry.annotations.EventListener;
import org.apache.tapestry.annotations.InitialValue;
import org.apache.tapestry.annotations.Persist;
import org.apache.tapestry.event.BrowserEvent;
import org.apache.tapestry.html.BasePage;
public abstract class TestEventListener extends BasePage implements
IExternalPage {
@Persist
@InitialValue("true")
public abstract void setClicked(boolean bool);
public abstract boolean getClicked();
private static final Log log = LogFactory.getLog(TestEventListener.class);
public void activateExternalPage(Object[] parameters, IRequestCycle cycle) {
}
@EventListener(events = "onclick", elements = "test", submitForm = "myForm")
public void clicked(){
log.info("Hi");
log.info(getClicked());
setClicked(!getClicked());
getRequestCycle().getResponseBuilder().updateComponent("refreshme");
}
}
This all works ok but if then update clicked to be:
@EventListener(events = "onclick", elements = "test", submitForm = "myForm")
public void clicked(BrowserEvent event){
log.info("Hi");
log.info(getClicked());
setClicked(!getClicked());
getRequestCycle().getResponseBuilder().updateComponent("refreshme");
}
it blows up at runtime with the error:
No listener method named 'clicked' suitable for no listener parameters found in
[EMAIL PROTECTED]
I'm accesing thsi test using the URL:
http://dbnycws72331.dbg.ads.db.com:8080/RDQ/app?service=external&page=TestEventListener
yell if you need any more info.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]