81926e46ccb2aab7d9a83d3624f7c7f74f64c03d.svn-base 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. <html>
  2. <head>
  3. <title>Test Invocation</title>
  4. <script type="text/javascript" src="../../../../dojo/dojo.js" djConfig="isDebug: true, parseOnLoad:true "></script>
  5. <script type="text/javascript">
  6. dojo.provide("dojox.wire.ml.tests.markup.Invocation");
  7. dojo.require("dojo.parser");
  8. dojo.require("doh.runner");
  9. dojo.require("dojox.wire.ml.Invocation");
  10. dojox.wire.ml.tests.markup.Invocation = {
  11. invoke: function(p1, p2){return p1 + p2;},
  12. invokeError: function(p){throw new Error(p);},
  13. parameters: {a: "A", b: "B", c: "C"}
  14. };
  15. dojo.addOnLoad(function(){
  16. doh.register("dojox.wire.ml.tests.markup.Invocation", [
  17. function test_Invocation_method(t){
  18. dojo.publish("invokeMethod");
  19. t.assertEqual("AB", dojox.wire.ml.tests.markup.Invocation.result);
  20. },
  21. function test_Invocation_topic(t){
  22. dojo.publish("invokeTopic");
  23. t.assertEqual("C", dojox.wire.ml.tests.markup.Invocation.error);
  24. }
  25. ]);
  26. doh.run();
  27. });
  28. </script>
  29. </head>
  30. <body>
  31. <div dojoType="dojox.wire.ml.Invocation"
  32. triggerTopic="invokeMethod"
  33. object="dojox.wire.ml.tests.markup.Invocation"
  34. method="invoke"
  35. parameters="dojox.wire.ml.tests.markup.Invocation.parameters.a,dojox.wire.ml.tests.markup.Invocation.parameters.b"
  36. result="dojox.wire.ml.tests.markup.Invocation.result"></div>
  37. <div dojoType="dojox.wire.ml.Invocation"
  38. triggerTopic="invokeTopic"
  39. topic="invokeError"
  40. parameters="dojox.wire.ml.tests.markup.Invocation.parameters.c"></div>
  41. <div dojoType="dojox.wire.ml.Invocation"
  42. triggerTopic="invokeError"
  43. object="dojox.wire.ml.tests.markup.Invocation"
  44. method="invokeError"
  45. error="dojox.wire.ml.tests.markup.Invocation.error"></div>
  46. </body>
  47. </html>