tapestry-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From thiag...@apache.org
Subject tapestry-5 git commit: TAP5-2225
Date Sun, 19 Mar 2017 21:31:19 GMT
Repository: tapestry-5
Updated Branches:
  refs/heads/5.4.x d8a7dbf9d -> 9b0d6492d


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/9b0d6492
Tree: http://git-wip-us.apache.org/repos/asf/tapestry-5/tree/9b0d6492
Diff: http://git-wip-us.apache.org/repos/asf/tapestry-5/diff/9b0d6492

Branch: refs/heads/5.4.x
Commit: 9b0d6492de88aa77809b98f0670dd95377d3da61
Parents: d8a7dbf
Author: Thiago H. de Paula Figueiredo <thiagohp@apache.org>
Authored: Sun Mar 19 18:31:07 2017 -0300
Committer: Thiago H. de Paula Figueiredo <thiagohp@apache.org>
Committed: Sun Mar 19 18:31:07 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/9b0d6492/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/9b0d6492/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]);
 	});
 


Mime
View raw message