I am attempting to utilize the @PublishEvent feature in Tapestry, which allows me to create a server-side event handler. However, I have encountered an issue where there is no data being passed from JavaScript to the Server in the example provided at the link above. Upon further investigation in the documentation found here, it seems that there is a "data" option available for passing necessary information. Despite my attempts, I have been unable to get this functionality working; only the "empty" method handler seems to be functional.
The code I have written looks like this:
JS:
ajax('action',{
element: $(element),
data: {
test:'test'
},
success: function(response) {
console.log(response);
}
}
JAVA:
@OnEvent("action")
@PublishEvent
public void action(JSONObject test)
{
//Code to handle execution
}
Any assistance on this matter would be greatly appreciated!