summaryrefslogtreecommitdiff
path: root/includes/js/dojox/wire/tests/markup/Invocation.html
blob: dd6f6e4ebbca1a294ce0ecb9c0d7407c16f33a99 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
<html>
<head>
<title>Test Invocation</title>
<script type="text/javascript" src="../../../../dojo/dojo.js" djConfig="isDebug: true, parseOnLoad:true "></script>
<script type="text/javascript">
dojo.provide("dojox.wire.ml.tests.markup.Invocation");

dojo.require("dojo.parser");
dojo.require("doh.runner");
dojo.require("dojox.wire.ml.Invocation");

dojox.wire.ml.tests.markup.Invocation = {
	invoke: function(p1, p2){return p1 + p2;},
	invokeError: function(p){throw new Error(p);},
	parameters: {a: "A", b: "B", c: "C"}
};

dojo.addOnLoad(function(){
	doh.register("dojox.wire.ml.tests.markup.Invocation", [

		function test_Invocation_method(t){
			dojo.publish("invokeMethod");
			t.assertEqual("AB", dojox.wire.ml.tests.markup.Invocation.result);
		},

		function test_Invocation_topic(t){
			dojo.publish("invokeTopic");
			t.assertEqual("C", dojox.wire.ml.tests.markup.Invocation.error);
		}

	]);
	doh.run();
});
</script>
</head>
<body>
<div dojoType="dojox.wire.ml.Invocation"
	triggerTopic="invokeMethod"
	object="dojox.wire.ml.tests.markup.Invocation"
	method="invoke"
	parameters="dojox.wire.ml.tests.markup.Invocation.parameters.a,dojox.wire.ml.tests.markup.Invocation.parameters.b"
	result="dojox.wire.ml.tests.markup.Invocation.result"></div>
<div dojoType="dojox.wire.ml.Invocation"
	triggerTopic="invokeTopic"
	topic="invokeError"
	parameters="dojox.wire.ml.tests.markup.Invocation.parameters.c"></div>
<div dojoType="dojox.wire.ml.Invocation"
	triggerTopic="invokeError"
	object="dojox.wire.ml.tests.markup.Invocation"
	method="invokeError"
	error="dojox.wire.ml.tests.markup.Invocation.error"></div>
</body>
</html>