summaryrefslogtreecommitdiff
path: root/includes/js/dojox/form/tests/test_CheckedMultiSelect.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/form/tests/test_CheckedMultiSelect.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/form/tests/test_CheckedMultiSelect.html')
-rw-r--r--includes/js/dojox/form/tests/test_CheckedMultiSelect.html91
1 files changed, 91 insertions, 0 deletions
diff --git a/includes/js/dojox/form/tests/test_CheckedMultiSelect.html b/includes/js/dojox/form/tests/test_CheckedMultiSelect.html
new file mode 100644
index 0000000..b8729d2
--- /dev/null
+++ b/includes/js/dojox/form/tests/test_CheckedMultiSelect.html
@@ -0,0 +1,91 @@
+<html>
+ <head>
+ <script type="text/javascript"
+ src="../../../dojo/dojo.js"
+ djConfig="isDebug: true, parseOnLoad: true">
+ </script>
+ <script type="text/javascript">
+ dojo.require("doh.runner");
+ dojo.require("dojo.parser");
+ dojo.require("dojox.form.CheckedMultiSelect");
+ dojo.require("dijit.form.Button");
+ dojo.require("dijit.form.Form");
+
+ dojo.addOnLoad(function(){
+ doh.register("tests",
+ [
+ function test_setValue(t){
+ t.is(["VA","WA"], form.getValues().ms1);
+ form.setValues({ms1: ["TN","CA"]});
+ t.is(["TN","CA"], form.getValues().ms1);
+ ms1.invertSelection();
+ t.is(["VA","WA","FL"], form.getValues().ms1);
+ },
+ function test_addSelected(t){
+ ms1.addSelected(ms2);
+ t.is([], form.getValues().ms2);
+ ms1.invertSelection();
+ t.is(["TN","CA"], form.getValues().ms1);
+ },
+ ]
+ );
+ doh.run();
+ dojo.connect(ms1, "onChange", function(val){
+ console.log("First Select Changed to " + val);
+ });
+ });
+ </script>
+ <style>
+ @import url(../../../dojo/resources/dojo.css);
+ @import url(../../../dijit/themes/tundra/tundra.css);
+ @import url(../resources/CheckedMultiSelect.css);
+ @import url(../../../dijit/tests/css/dijitTests.css);
+ </style>
+ </head>
+ <body class="tundra">
+ <h1 class="testTitle">Test: dojox.form.CheckedMultiSelect</h1>
+ <h2>Automated test</h2>
+ <form dojoType="dijit.form.Form" jsId="form">
+ <select jsId="ms1" multiple="true" name="ms1" dojoType="dojox.form.CheckedMultiSelect">
+ <option value="TN">Tennessee</option>
+ <option value="VA" selected="selected">Virginia</option>
+ <option value="WA" selected="selected">Washington</option>
+ <option value="FL">Florida</option>
+ <option value="CA">California</option>
+ </select>
+ <hr>
+ <select jsId="ms2" multiple="true" name="ms2" dojoType="dojox.form.CheckedMultiSelect">
+ <option value="UT">Utah</option>
+ <option value="TX" selected="selected">Texas</option>
+ <option value="GA" selected="selected">Georgia</option>
+ <option value="ID">Idaho</option>
+ <option value="WY">Wyoming</option>
+ <option value="OR">Oregon</option>
+ <option value="PA">Pennsylvania</option>
+ </select>
+ <hr>
+ <select jsId="ms3" multiple="true" name="ms3" dojoType="dojox.form.CheckedMultiSelect">
+ </select>
+ <hr>
+ <button dojoType="dijit.form.Button">
+ <script type="dojo/method" event="onClick">
+ console.dir(form.getValues());
+ </script>
+ Get Values
+ </button>
+ <button dojoType="dijit.form.Button">
+ <script type="dojo/method" event="onClick">
+ var idx = dojo.query("option", ms3.domNode).length;
+ ms3.addOption(idx + "", "Option " + (idx + 1));
+ </script>
+ Add Option
+ </button>
+ <button dojoType="dijit.form.Button">
+ <script type="dojo/method" event="onClick">
+ ms3.setAttribute("disabled", !ms3.disabled);
+ </script>
+ Toggle Disabled
+ </button>
+ </form>
+ </body>
+</html>