EventListener invoke all listener inside a form eventhought only one event was
trigger
--------------------------------------------------------------------------------------
Key: TAPESTRY-1046
URL: http://issues.apache.org/jira/browse/TAPESTRY-1046
Project: Tapestry
Issue Type: Bug
Components: Annotations
Affects Versions: 4.1
Environment: OS: Sun Solaris
Tapestry version: 4.1.1
Reporter: dinh anh khoa
Priority: Critical
I had a html template as folow:
<form jwcid="[EMAIL PROTECTED]" listener="listener:listener1">
<div jwcid="[EMAIL PROTECTED]" id="valueDiv" >
<span jwcid="@Insert" value="myValue1" />
<span jwcid="@Insert" value="myValue2" />
<div>
<button type="button" jwcid="[EMAIL PROTECTED]" id="btn1" value="Hit
me1" />
<button type="button" jwcid="[EMAIL PROTECTED]" id="btn2" value="Hit
me2" />
</form>
And I declared in java file as folow:
public abstract void setMyValue1(String s);
public abstract void setMyValue2(String s);
@EventListener(events = "onclick", targets = "btn1", submitForm = "myForm")
public void listener1(IRequestCycle cycle) {
setMyValue1( Math.random() + "" );
}
@EventListener(events = "onclick", targets = "btn2", submitForm = "myForm")
public void listener2(IRequestCycle cycle) {
setMyValue2( Math.random() + "" );
}
public void listener(IRequestCycle cycle) {
System.out.println("do nothing");
}
After page rendered, If I click on one of two buttons 'Hit me1' or 'Hitme2'
then I saw that all of three listener method were called.
I dont known exactly this is a bug or not, maybe I wrong some thing but I have
never see this problem if I use Submit component. Please let me known.
--
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]