Repository: tapestry-5 Updated Branches: refs/heads/master 9977826cf -> 9ffa2c661
TAP5-2225 Create client-side API to call a component's event handler methods Project: http://git-wip-us.apache.org/repos/asf/tapestry-5/repo Commit: http://git-wip-us.apache.org/repos/asf/tapestry-5/commit/004d9afc Tree: http://git-wip-us.apache.org/repos/asf/tapestry-5/tree/004d9afc Diff: http://git-wip-us.apache.org/repos/asf/tapestry-5/diff/004d9afc Branch: refs/heads/master Commit: 004d9afc87950bc581afa7d0bacc9e52bf512ea5 Parents: 9977826 Author: Thiago H. de Paula Figueiredo <[email protected]> Authored: Sun Mar 19 18:31:07 2017 -0300 Committer: Thiago H. de Paula Figueiredo <[email protected]> Committed: Sun Mar 19 18:32:00 2017 -0300 ---------------------------------------------------------------------- .../integration/app1/components/PublishEventDemoComponent.java | 4 ++-- .../src/test/resources/META-INF/assets/PublishEventDemo.js | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/tapestry-5/blob/004d9afc/tapestry-core/src/test/java/org/apache/tapestry5/integration/app1/components/PublishEventDemoComponent.java ---------------------------------------------------------------------- diff --git a/tapestry-core/src/test/java/org/apache/tapestry5/integration/app1/components/PublishEventDemoComponent.java b/tapestry-core/src/test/java/org/apache/tapestry5/integration/app1/components/PublishEventDemoComponent.java index e402cbc..489962d 100644 --- a/tapestry-core/src/test/java/org/apache/tapestry5/integration/app1/components/PublishEventDemoComponent.java +++ b/tapestry-core/src/test/java/org/apache/tapestry5/integration/app1/components/PublishEventDemoComponent.java @@ -20,13 +20,13 @@ public class PublishEventDemoComponent @OnEvent("answer") @PublishEvent JSONObject answer() { - return new JSONObject("origin", "componentAction"); + return new JSONObject("origin", "componentAnswer"); } @PublishEvent JSONObject onAction() { - return new JSONObject("origin", "componentAnswer"); + return new JSONObject("origin", "componentAction"); } } http://git-wip-us.apache.org/repos/asf/tapestry-5/blob/004d9afc/tapestry-core/src/test/resources/META-INF/assets/PublishEventDemo.js ---------------------------------------------------------------------- diff --git a/tapestry-core/src/test/resources/META-INF/assets/PublishEventDemo.js b/tapestry-core/src/test/resources/META-INF/assets/PublishEventDemo.js index d10eab0..ca143dd 100644 --- a/tapestry-core/src/test/resources/META-INF/assets/PublishEventDemo.js +++ b/tapestry-core/src/test/resources/META-INF/assets/PublishEventDemo.js @@ -1,7 +1,7 @@ require(["t5/core/dom", "t5/core/ajax", "jquery"], function (dom, ajax, $) { function makeAjaxCall(eventName, eventElement, outputElement) { - ajax('action', { + ajax(eventName, { element: eventElement, success: function(response) { outputElement.innerHTML = response.json.origin; @@ -16,7 +16,7 @@ require(["t5/core/dom", "t5/core/ajax", "jquery"], function (dom, ajax, $) { var eventElement = null; if (elementId != '(no element)') { eventElement = $('#' + elementId); - } + } makeAjaxCall(eventName, eventElement, td[3]); });
