aboutsummaryrefslogtreecommitdiff
path: root/includes/js/dojox/wire/demos/markup/demo_TopicWiring.html
diff options
context:
space:
mode:
authormensonge <mensonge@b3834d28-1941-0410-a4f8-b48e95affb8f>2008-11-13 09:49:11 +0000
committermensonge <mensonge@b3834d28-1941-0410-a4f8-b48e95affb8f>2008-11-13 09:49:11 +0000
commite44a7e37b6c7b5961adaffc62b9042b8d442938e (patch)
tree95b67c356e93163467db2451f2b8cce84ed5d582 /includes/js/dojox/wire/demos/markup/demo_TopicWiring.html
parenta62b9742ee5e28bcec6872d88f50f25b820914f6 (diff)
downloadsemanticscuttle-e44a7e37b6c7b5961adaffc62b9042b8d442938e.tar.gz
semanticscuttle-e44a7e37b6c7b5961adaffc62b9042b8d442938e.tar.bz2
New feature: basic Ajax suggestion for tags and implementation of Dojo toolkit
git-svn-id: https://semanticscuttle.svn.sourceforge.net/svnroot/semanticscuttle/trunk@151 b3834d28-1941-0410-a4f8-b48e95affb8f
Diffstat (limited to 'includes/js/dojox/wire/demos/markup/demo_TopicWiring.html')
-rw-r--r--includes/js/dojox/wire/demos/markup/demo_TopicWiring.html78
1 files changed, 78 insertions, 0 deletions
diff --git a/includes/js/dojox/wire/demos/markup/demo_TopicWiring.html b/includes/js/dojox/wire/demos/markup/demo_TopicWiring.html
new file mode 100644
index 0000000..e091e8b
--- /dev/null
+++ b/includes/js/dojox/wire/demos/markup/demo_TopicWiring.html
@@ -0,0 +1,78 @@
+<!--
+ This file demonstrates how the dojox.wire code can be used to do declarative
+ wiring of events. Specifically, it shows how you can publish and subscribe
+ to topics. In this case the setting of a value on one textbox triggers a
+ publish of that value to a topic. Another invoke is wired to fire when
+ values are published to that topic which is then displayed in another
+ textbox.
+-->
+<html>
+<head>
+ <title>Sample Topic Wiring</title>
+ <style type="text/css">
+
+ @import "../../../../dijit/themes/tundra/tundra.css";
+ @import "../../../../dojo/resources/dojo.css";
+ @import "../../../../dijit/tests/css/dijitTests.css";
+ @import "../TableContainer.css";
+
+ .splitView {
+ width: 90%;
+ height: 90%;
+ border: 1px solid #bfbfbf;
+ border-collapse: separate;
+ }
+ </style>
+
+ <script type="text/javascript" src="../../../../dojo/dojo.js" djConfig="isDebug: true, parseOnLoad: true"></script>
+ <script type="text/javascript">
+ dojo.require("dojo.parser");
+ dojo.require("dojox.wire");
+ dojo.require("dojox.wire.ml.Invocation");
+ dojo.require("dojox.wire.ml.DataStore");
+ dojo.require("dojox.wire.ml.Transfer");
+ dojo.require("dojox.wire.ml.Data");
+
+ dojo.require("dijit.form.TextBox");
+ </script>
+</head>
+
+<body class="tundra">
+
+ <!-- Layout -->
+ <font size="3"><b>Demo of Topic Wiring</b></font><br/><br/>
+ This demo shows how you can wire events to publish to a topic as well as recieve topic events
+ <br/>
+ <br/>
+ <table>
+ <tr>
+ <td>
+ <div dojoType="dijit.form.TextBox" jsId="inputField" value="" size="50"></div>
+ </td>
+ </tr>
+ <tr>
+ <td>
+ <div dojoType="dijit.form.TextBox" jsId="targetField1" value="" disabled="true" size="50"></div>
+ </td>
+ </tr>
+ </table>
+
+
+ <!-------------------------------- Using dojox.wire, declaratively wire up the widgets. --------------------------->
+
+ <!--
+ Whenever a key is entered into the textbox, publish the value of it to a topic.
+ -->
+ <div dojoType="dojox.wire.ml.Action"
+ id="action1"
+ trigger="inputField"
+ triggerEvent="onkeyup">
+ <div dojoType="dojox.wire.ml.Invocation" topic="sampleTopic" parameters="inputField.value"></div>
+ </div>
+
+ <!--
+ Whenever a value is published to a topic, set it as the value of the textbox by calling the setValue function.
+ -->
+ <div dojoType="dojox.wire.ml.Invocation" triggerTopic="sampleTopic" object="targetField1" method="setValue" parameters="arguments[0]"></div>
+</body>
+</html>