Details
-
Type:
Bug
-
Status:
Open
-
Priority:
Major
-
Resolution: Unresolved
-
Affects Version/s: None
-
Fix Version/s: None
-
Component/s: None
-
Labels:None
-
Number of attachments :
Description
to reproduce do the following:
create a quickstart tapestry app 5.3.2: "mvn archetype:generate -DarchetypeCatalog=http://tapestry.apache.org"
add chenillekit 1.3.3 dependancies to pom.xml:
<dependency>
<groupId>org.chenillekit</groupId>
<artifactId>chenillekit-tapestry</artifactId>
<version>1.3.3</version>
</dependency>
create a java file called Test.java:
package test.pages;
import org.apache.tapestry5.annotations.OnEvent;
import org.apache.tapestry5.json.JSONObject;
import org.apache.tapestry5.ioc.internal.util.TapestryException;
public class Test {
@OnEvent(component = "textfield", value = "blur")
public JSONObject onBlurEvent(String value)
{
String translatedValue = "Please welcome me before speek!";
if (value.equalsIgnoreCase("hello"))
{ translatedValue = "Hello to you, too!"; } return new JSONObject().put("translatedValue", translatedValue);
}
}
create a tml file Test.tml:
—
<html xmlns:t="http://tapestry.apache.org/schema/tapestry_5_0_0.xsd">
<body>
<h1>Hello Guys and Dolls</h1>
<form t:type="Form">
<input t:type="TextField" value="textFieldValue" t:mixins="ck/OnEvent"
event="blur" onCompleteCallback="onCompleteFunction"/>;
</form>
<p>
for text field the javascript event returns : <span id="onTextFieldChangeResult"></span>
</p>
<script type="text/javascript">
function onTextFieldCompleteFunction(response)
</body>
</html>
—
compile and open the Test page.
Will produce the following error:
"Illegal field modifiers in class org/chenillekit/tapestry/core/base/EventMixin"
added the exception output as textfile
A quick fix is to move the interface OnEvent to the internal package, interfaces are no longer allowed in the base package.
See: https://issues.apache.org/jira/browse/TAP5-1851