| 1 |
<!DOCTYPE html> |
| 2 |
<html> |
| 3 |
<head> |
| 4 |
<meta http-equiv="Content-type" content="text/html; charset=utf-8"> |
| 5 |
<title>MVC DOH Test</title> |
| 6 |
|
| 7 |
<style> |
| 8 |
@import "../../../../../dojo/resources/dojo.css"; |
| 9 |
@import "../../../../../dijit/tests/css/dijitTests.css"; |
| 10 |
@import "../css/app-format.css"; |
| 11 |
</style> |
| 12 |
|
| 13 |
|
| 14 |
<link id="themeStyles" rel="stylesheet" href="../../../../../dijit/themes/claro/claro.css"/> |
| 15 |
|
| 16 |
|
| 17 |
<script src="../../../../../dojo/dojo.js" type="text/javascript" |
| 18 |
djConfig="isDebug: true"> |
| 19 |
</script> |
| 20 |
<script type="text/javascript" src="../helpers.js"></script> |
| 21 |
|
| 22 |
<script type="text/javascript" > |
| 23 |
dojo.require("dojox.mvc"); |
| 24 |
dojo.require("dojox.mvc.Output"); |
| 25 |
dojo.require("dijit.form.TextBox"); |
| 26 |
dojo.require("dijit.form.Button"); |
| 27 |
dojo.require("dijit.form.Select"); |
| 28 |
dojo.require("dijit.form.FilteringSelect"); |
| 29 |
dojo.require("dijit.form.ComboBox"); |
| 30 |
dojo.require("dijit.form.DateTextBox"); |
| 31 |
dojo.require("dijit.form.HorizontalSlider"); |
| 32 |
dojo.require("dijit.form.NumberSpinner"); |
| 33 |
dojo.require("dijit.form.NumberTextBox"); |
| 34 |
dojo.require("dijit.form.SimpleTextarea"); |
| 35 |
dojo.require("dijit.form.Textarea"); |
| 36 |
dojo.require("dojo.data.ItemFileReadStore"); |
| 37 |
dojo.require("dijit.Calendar"); |
| 38 |
dojo.require("dijit.ColorPalette"); |
| 39 |
dojo.require("dojo.date.locale"); |
| 40 |
dojo.require("dojo.parser"); |
| 41 |
// The dojox.mvc.StatefulModel class creates a data model instance |
| 42 |
// where each leaf within the data model is decorated with dojo.Stateful |
| 43 |
// properties that widgets can bind to and watch for their changes. |
| 44 |
|
| 45 |
var alreadyset = false; |
| 46 |
var data = [ |
| 47 |
{id: '1',name:"one"}, |
| 48 |
{id: '2',name:"two"}, |
| 49 |
{id: '3',name:"three"}, |
| 50 |
{id: '4',name:"four"}, |
| 51 |
{id: '5',name:"five"}, |
| 52 |
{id: '6',name:"six"}, |
| 53 |
{id: '7',name:"seven"}, |
| 54 |
{id: '8',name:"eight"}, |
| 55 |
{id: '9',name:"nine"}, |
| 56 |
{id: '10',name:"ten"}, |
| 57 |
{id: '11',name:"eleven"}, |
| 58 |
{id: '12',name:"twelve"}, |
| 59 |
{id: '13',name:"thirteen"} |
| 60 |
]; |
| 61 |
var store = new dojo.data.ItemFileReadStore({ |
| 62 |
data: { |
| 63 |
identifier: 'id', |
| 64 |
label: 'name', |
| 65 |
items: data |
| 66 |
} |
| 67 |
}); |
| 68 |
|
| 69 |
var data2 = { |
| 70 |
identifier: "value", |
| 71 |
label: "label", |
| 72 |
items: [ |
| 73 |
{value: "1", label: "one"}, |
| 74 |
{value: "2", label: "two"}, |
| 75 |
{value: "3", label: "three"}, |
| 76 |
{value: "4", label: "four"}, |
| 77 |
{value: "5", label: "five"}, |
| 78 |
{value: "6", label: "six"}, |
| 79 |
{value: "7", label: "seven"}, |
| 80 |
{value: "8", label: "eigth"}, |
| 81 |
{value: "9", label: "nine"}, |
| 82 |
{value: "10", label: "ten"}, |
| 83 |
{value: "11", label: "eleven"}, |
| 84 |
{value: "12", label: "twelve"}, |
| 85 |
{value: "13", label: "thirteen"}, |
| 86 |
{value: "14", label: "fourteen"} |
| 87 |
] |
| 88 |
}; |
| 89 |
var store2 = new dojo.data.ItemFileReadStore({data:dojo.clone(data2)}); |
| 90 |
|
| 91 |
// create models for selects |
| 92 |
var selmodel = new dojox.mvc.newStatefulModel({data: {number: '1'}}); |
| 93 |
var decselmodel = new dojox.mvc.newStatefulModel({data: {number: '1'}}); |
| 94 |
|
| 95 |
// create models for filtering selects |
| 96 |
var filmodel = new dojox.mvc.newStatefulModel({data: {number: '2'}}); |
| 97 |
var decfilmodel = new dojox.mvc.newStatefulModel({data: {number: '2'}}); |
| 98 |
|
| 99 |
// create models for ComboBoxes |
| 100 |
var combomodel = new dojox.mvc.newStatefulModel({data: {number: 'three'}}); |
| 101 |
var deccombomodel = new dojox.mvc.newStatefulModel({data: {number: 'three'}}); |
| 102 |
|
| 103 |
// create a model for DateTextBox |
| 104 |
var datemodel = new dojox.mvc.newStatefulModel({data: {number: new Date(2011, 3, 4)}}); |
| 105 |
var decdatemodel = new dojox.mvc.newStatefulModel({data: {number: new Date(2011, 3, 4)}}); |
| 106 |
|
| 107 |
// create a model for Slider |
| 108 |
var slidermodel = new dojox.mvc.newStatefulModel({data: {number: '5'}}); |
| 109 |
var decslidermodel = new dojox.mvc.newStatefulModel({data: {number: '5'}}); |
| 110 |
|
| 111 |
// create a model for NumberSpinner |
| 112 |
var numspinmodel = new dojox.mvc.newStatefulModel({data: {number: '6'}}); |
| 113 |
var decnumspinmodel = new dojox.mvc.newStatefulModel({data: {number: '6'}}); |
| 114 |
|
| 115 |
// create a model for SimpleTextArea |
| 116 |
var simpTAmodel = new dojox.mvc.newStatefulModel({data: {number: '7'}}); |
| 117 |
var decsimpTAmodel = new dojox.mvc.newStatefulModel({data: {number: '7'}}); |
| 118 |
|
| 119 |
// create a model for TextArea |
| 120 |
var textareamodel = new dojox.mvc.newStatefulModel({data: {number: '8'}}); |
| 121 |
var dectextareamodel = new dojox.mvc.newStatefulModel({data: {number: '8'}}); |
| 122 |
|
| 123 |
// create a model for dijit.Calendar |
| 124 |
var deccalmodel = new dojox.mvc.newStatefulModel({data: {date: new Date(2011,4,4)}}); |
| 125 |
|
| 126 |
// create a model for dijit.ColorPalette |
| 127 |
var deccolormodel = new dojox.mvc.newStatefulModel({data: {code: "#000000"}}); |
| 128 |
|
| 129 |
var nanmodel = new dojox.mvc.newStatefulModel({data: {num: null}}); |
| 130 |
|
| 131 |
</script> |
| 132 |
|
| 133 |
<script type="text/javascript"> |
| 134 |
dojo.require('doh.runner'); |
| 135 |
dojo.require("dijit.dijit"); // optimize: load dijit layer |
| 136 |
dojo.require("dojo.parser"); // scan page for widgets and instantiate them |
| 137 |
|
| 138 |
dojo.addOnLoad(function(){ |
| 139 |
|
| 140 |
doh.register("parse", function(){ |
| 141 |
dummyDateWid = new dijit.form.DateTextBox({constraints:{datePattern:"MM-dd-yyyy", strict:true}}); |
| 142 |
|
| 143 |
dojo.parser.parse(); |
| 144 |
|
| 145 |
// Handle the programmatic creation of widgets here: |
| 146 |
|
| 147 |
// create the select, textbox, output and button |
| 148 |
var sel = new dijit.form.Select({ |
| 149 |
store: store, |
| 150 |
loadChildrenOnOpen: true, |
| 151 |
ref: selmodel.number // bind to model.number |
| 152 |
}, document.getElementById('sel')); |
| 153 |
|
| 154 |
var text = new dijit.form.TextBox({ |
| 155 |
//id: "seltext", |
| 156 |
ref: selmodel.number |
| 157 |
}, document.getElementById('seltext')); |
| 158 |
text.startup(); |
| 159 |
|
| 160 |
var selOutput = new dojox.mvc.Output({ |
| 161 |
ref: selmodel.number |
| 162 |
}, document.getElementById('selOutput')); |
| 163 |
selOutput.startup(); |
| 164 |
|
| 165 |
var reset1 = new dijit.form.Button({ |
| 166 |
onClick: function(){selmodel.reset();}, |
| 167 |
id: "selReset", |
| 168 |
label: "Reset" |
| 169 |
}, document.getElementById('reset1')); |
| 170 |
reset1.startup(); |
| 171 |
|
| 172 |
|
| 173 |
sel.watch('value', function () { |
| 174 |
//console.log('sel value changed', arguments); |
| 175 |
}); |
| 176 |
|
| 177 |
text.watch('value', function () { |
| 178 |
//console.log('text value changed', arguments); |
| 179 |
}); |
| 180 |
|
| 181 |
sel.startup(); |
| 182 |
|
| 183 |
|
| 184 |
// create the filtering select, textbox, output and button |
| 185 |
var filsel = new dijit.form.FilteringSelect({ |
| 186 |
store: store, |
| 187 |
ref: filmodel.number // bind to model.number |
| 188 |
}, document.getElementById('filsel')); |
| 189 |
|
| 190 |
var filtext = new dijit.form.TextBox({ |
| 191 |
ref: filmodel.number |
| 192 |
}, document.getElementById('filtext')); |
| 193 |
|
| 194 |
var filoutput = new dojox.mvc.Output({ |
| 195 |
ref: filmodel.number |
| 196 |
}, document.getElementById('filoutput')); |
| 197 |
filoutput.startup(); |
| 198 |
|
| 199 |
var filreset = new dijit.form.Button({ |
| 200 |
onClick: function(){filmodel.reset();}, |
| 201 |
id: "filReset", |
| 202 |
label: "Reset" |
| 203 |
}, document.getElementById('filreset')); |
| 204 |
filreset.startup(); |
| 205 |
|
| 206 |
filtext.startup(); |
| 207 |
filsel.startup(); |
| 208 |
|
| 209 |
// create the comboBox, textbox, output and button |
| 210 |
var combo = new dijit.form.ComboBox({ |
| 211 |
store: store, |
| 212 |
ref: combomodel.number // bind to model.number |
| 213 |
}, document.getElementById('combosel')); |
| 214 |
|
| 215 |
var combotext = new dijit.form.TextBox({ |
| 216 |
ref: combomodel.number |
| 217 |
}, document.getElementById('combotext')); |
| 218 |
|
| 219 |
var combooutput = new dojox.mvc.Output({ |
| 220 |
ref: combomodel.number |
| 221 |
}, document.getElementById('combooutput')); |
| 222 |
combooutput.startup(); |
| 223 |
|
| 224 |
var comboreset = new dijit.form.Button({ |
| 225 |
onClick: function(){combomodel.reset();}, |
| 226 |
id: "comboReset", |
| 227 |
label: "Reset" |
| 228 |
}, document.getElementById('comboreset')); |
| 229 |
comboreset.startup(); |
| 230 |
|
| 231 |
combotext.startup(); |
| 232 |
combo.startup(); |
| 233 |
|
| 234 |
var dateWid = new dijit.form.DateTextBox({ |
| 235 |
ref: datemodel.number // bind to model.number |
| 236 |
}, document.getElementById('datesel')); |
| 237 |
dateWid.constraints = dummyDateWid.constraints; |
| 238 |
dateWid.dateLocaleModule = dummyDateWid.dateLocaleModule; |
| 239 |
dateWid.format = dummyDateWid.format; |
| 240 |
dateWid.startup(); |
| 241 |
|
| 242 |
var datetext = new dijit.form.TextBox({ |
| 243 |
disabled : true, |
| 244 |
ref: datemodel.number |
| 245 |
}, document.getElementById('datetext')); |
| 246 |
datetext.constraints = dummyDateWid.constraints; |
| 247 |
datetext.dateLocaleModule = dummyDateWid.dateLocaleModule; |
| 248 |
datetext.format = dummyDateWid.format; |
| 249 |
datetext.startup(); |
| 250 |
|
| 251 |
var dateoutput = new dojox.mvc.Output({ |
| 252 |
ref: datemodel.number |
| 253 |
}, document.getElementById('dateoutput')); |
| 254 |
dateoutput.startup(); |
| 255 |
|
| 256 |
var datereset = new dijit.form.Button({ |
| 257 |
onClick: function(){datemodel.reset();}, |
| 258 |
id: "dateReset", |
| 259 |
label: "Reset" |
| 260 |
}, document.getElementById('datereset')); |
| 261 |
datereset.startup(); |
| 262 |
|
| 263 |
|
| 264 |
// create the dijit.form.HorizontalSlider, textbox, output and button |
| 265 |
var sliderWid = new dijit.form.HorizontalSlider({ |
| 266 |
style:{width:"190px"}, |
| 267 |
minimum:0, |
| 268 |
maximum:100, |
| 269 |
discreteValues:21, |
| 270 |
ref: slidermodel.number // bind to model.number |
| 271 |
}, document.getElementById('slidersel')); |
| 272 |
|
| 273 |
var slidertext = new dijit.form.TextBox({ |
| 274 |
ref: slidermodel.number |
| 275 |
}, document.getElementById('slidertext')); |
| 276 |
|
| 277 |
var slideroutput = new dojox.mvc.Output({ |
| 278 |
ref: slidermodel.number |
| 279 |
}, document.getElementById('slideroutput')); |
| 280 |
slideroutput.startup(); |
| 281 |
|
| 282 |
var sliderreset = new dijit.form.Button({ |
| 283 |
onClick: function(){slidermodel.reset();}, |
| 284 |
id: "sliderReset", |
| 285 |
label: "Reset" |
| 286 |
}, document.getElementById('sliderreset')); |
| 287 |
sliderreset.startup(); |
| 288 |
|
| 289 |
slidertext.startup(); |
| 290 |
sliderWid.startup(); |
| 291 |
|
| 292 |
// create the dijit.form.NumberSpinner, textbox, output and button |
| 293 |
var numspinWid = new dijit.form.NumberSpinner({ |
| 294 |
// constraints:{max:100,places:0}, |
| 295 |
ref: numspinmodel.number // bind to model.number |
| 296 |
}, document.getElementById('numspinsel')); |
| 297 |
|
| 298 |
var numspintext = new dijit.form.TextBox({ |
| 299 |
ref: numspinmodel.number |
| 300 |
}, document.getElementById('numspintext')); |
| 301 |
|
| 302 |
var numspinoutput = new dojox.mvc.Output({ |
| 303 |
ref: numspinmodel.number |
| 304 |
}, document.getElementById('numspinoutput')); |
| 305 |
numspinoutput.startup(); |
| 306 |
|
| 307 |
var numspinreset = new dijit.form.Button({ |
| 308 |
onClick: function(){numspinmodel.reset();}, |
| 309 |
id: "numspinReset", |
| 310 |
label: "Reset" |
| 311 |
}, document.getElementById('numspinreset')); |
| 312 |
numspinreset.startup(); |
| 313 |
|
| 314 |
numspintext.startup(); |
| 315 |
numspinWid.startup(); |
| 316 |
|
| 317 |
// create the dijit.form.SimpleTextarea, textbox, output and button |
| 318 |
var simpTAWid = new dijit.form.SimpleTextarea({ |
| 319 |
style:{height:"20px", width:"180px"}, |
| 320 |
ref: simpTAmodel.number // bind to model.number |
| 321 |
}, document.getElementById('simpTAsel')); |
| 322 |
|
| 323 |
var simpTAtext = new dijit.form.TextBox({ |
| 324 |
ref: simpTAmodel.number |
| 325 |
}, document.getElementById('simpTAtext')); |
| 326 |
|
| 327 |
var simpTAoutput = new dojox.mvc.Output({ |
| 328 |
ref: simpTAmodel.number |
| 329 |
}, document.getElementById('simpTAoutput')); |
| 330 |
simpTAoutput.startup(); |
| 331 |
|
| 332 |
var simpTAreset = new dijit.form.Button({ |
| 333 |
onClick: function(){simpTAmodel.reset();}, |
| 334 |
id: "simpTAReset", |
| 335 |
label: "Reset" |
| 336 |
}, document.getElementById('simpTAreset')); |
| 337 |
simpTAreset.startup(); |
| 338 |
|
| 339 |
simpTAtext.startup(); |
| 340 |
simpTAWid.startup(); |
| 341 |
|
| 342 |
// create the dijit.form.Textarea, textbox, output and button |
| 343 |
var textareaWid = new dijit.form.Textarea({ |
| 344 |
// constraints:{max:100,places:0}, |
| 345 |
ref: textareamodel.number // bind to model.number |
| 346 |
}, document.getElementById('textareasel')); |
| 347 |
|
| 348 |
var textareatext = new dijit.form.TextBox({ |
| 349 |
ref: textareamodel.number |
| 350 |
}, document.getElementById('textareatext')); |
| 351 |
|
| 352 |
var textareaoutput = new dojox.mvc.Output({ |
| 353 |
ref: textareamodel.number |
| 354 |
}, document.getElementById('textareaoutput')); |
| 355 |
textareaoutput.startup(); |
| 356 |
|
| 357 |
var textareareset = new dijit.form.Button({ |
| 358 |
onClick: function(){textareamodel.reset();}, |
| 359 |
id: "textareaReset", |
| 360 |
label: "Reset" |
| 361 |
}, document.getElementById('textareareset')); |
| 362 |
textareareset.startup(); |
| 363 |
|
| 364 |
textareatext.startup(); |
| 365 |
textareaWid.startup(); |
| 366 |
|
| 367 |
var numBox = new dijit.form.NumberTextBox({ |
| 368 |
ref: nanmodel.num // bind to model.num |
| 369 |
}, document.getElementById('nannb')); |
| 370 |
|
| 371 |
numBox.startup(); |
| 372 |
|
| 373 |
|
| 374 |
}); |
| 375 |
|
| 376 |
// should be able to verify all of the inputs |
| 377 |
//console.log("This test is commented out because it will fail if _FromSelectWidget is not updated to setup the store in postCreate instead of startup, see ticket 13372 for details."); |
| 378 |
|
| 379 |
doh.register("Check initial programatic values and bindings for select widget only", [ |
| 380 |
{ |
| 381 |
name: "initialSelectOnly", |
| 382 |
runTest: function(){ |
| 383 |
var wid, textboxval, outputval; |
| 384 |
// Test Select |
| 385 |
wid = dijit.byId("sel"); |
| 386 |
textboxval = dijit.byId("seltext").value; |
| 387 |
outputval = dijit.byId("selOutput").value; |
| 388 |
if (wid) { |
| 389 |
doh.is("1",wid.get('value'),"This test will fail if _FromSelectWidget is not updated to setup the store in postCreate instead of startup, see ticket 13372 for details."); |
| 390 |
doh.is(textboxval,wid.get('value'),"wid.get('value') should be set same as textboxval"); |
| 391 |
doh.is(outputval,wid.get('value'),"wid.get('value') should be set same as outputval"); |
| 392 |
} |
| 393 |
} |
| 394 |
} |
| 395 |
]); |
| 396 |
|
| 397 |
doh.register("Check initial programatic values and bindings widgets other than select", [ |
| 398 |
{ |
| 399 |
name: "initialOtherThanSelect", |
| 400 |
runTest: function(){ |
| 401 |
var wid, textboxval, outputval; |
| 402 |
// Test FilteringSelect |
| 403 |
wid = dijit.byId("filsel"); |
| 404 |
textboxval = dijit.byId("filtext").value; |
| 405 |
outputval = dijit.byId("filoutput").value; |
| 406 |
if (wid) { |
| 407 |
doh.is("2",wid.get('value'),"wid.get('value') should be set"); |
| 408 |
doh.is("two",wid.displayedValue,"wid.displayedValue should be set"); |
| 409 |
doh.is(textboxval,wid.get('value'),"wid.get('value') should be set same as textboxval"); |
| 410 |
doh.is(outputval,wid.get('value'),"wid.get('value') should be set same as outputval"); |
| 411 |
} |
| 412 |
// Test dijit.form.ComboBox |
| 413 |
wid = dijit.byId("combosel"); |
| 414 |
textboxval = dijit.byId("combotext").value; |
| 415 |
outputval = dijit.byId("combooutput").value; |
| 416 |
if (wid) { |
| 417 |
doh.is("three",wid.get('value'),"wid.get('value') should be set"); |
| 418 |
doh.is("three",wid.displayedValue,"wid.displayedValue should be set"); |
| 419 |
doh.is(textboxval,wid.get('value'),"wid.get('value') should be set same as textboxval"); |
| 420 |
doh.is(outputval,wid.get('value'),"wid.get('value') should be set same as outputval"); |
| 421 |
} |
| 422 |
// Test dijit.form.DateTextBox |
| 423 |
wid = dijit.byId("datesel"); |
| 424 |
textboxval = dijit.byId("datetext").displayedValue; |
| 425 |
outputval = dijit.byId("dateoutput").value; |
| 426 |
if (wid) { |
| 427 |
var date = new Date(2011, 3, 4, 0, 0, 0, 0); |
| 428 |
doh.is(date.getTime(), wid.get("value").getTime(), "wid.get(\"value\") should be set it is:" + wid.get("value")); |
| 429 |
doh.is("04-04-2011", wid.displayedValue, "wid.displayedValue should be set it is:" + wid.displayedValue); |
| 430 |
doh.is("04-04-2011", textboxval, "textboxval should be set it is:" + textboxval); |
| 431 |
doh.is(date.getTime(), outputval.getTime(), "outputval should be set to match date:" + date); |
| 432 |
} |
| 433 |
// Test dijit.form.HorizontalSlider |
| 434 |
wid = dijit.byId("slidersel"); |
| 435 |
textboxval = dijit.byId("slidertext").value; |
| 436 |
outputval = dijit.byId("slideroutput").value; |
| 437 |
if (wid) { |
| 438 |
doh.is("5",wid.get('value'),"wid.get('value') should be set"); |
| 439 |
//doh.is("five",wid.displayedValue,"wid.displayedValue should be set"); |
| 440 |
doh.is(textboxval,wid.get('value'),"wid.get('value') should be set same as textboxval"); |
| 441 |
doh.is(outputval,wid.get('value'),"wid.get('value') should be set same as outputval"); |
| 442 |
} |
| 443 |
// Test dijit.form.NumberSpinner |
| 444 |
wid = dijit.byId("numspinsel"); |
| 445 |
textboxval = dijit.byId("numspintext").value; |
| 446 |
outputval = dijit.byId("numspinoutput").value; |
| 447 |
if (wid) { |
| 448 |
//doh.is("6",wid.get('value'),"wid.get('value') should be set"); |
| 449 |
doh.is("6",wid.displayedValue,"wid.displayedValue should be set"); |
| 450 |
doh.is(textboxval,wid.displayedValue,"wid.displayedValue should be set same as textboxval"); |
| 451 |
doh.is(outputval,wid.displayedValue,"wid.displayedValue should be set same as outputval"); |
| 452 |
} |
| 453 |
// Test dijit.form.SimpleTextarea |
| 454 |
wid = dijit.byId("simpTAsel"); |
| 455 |
textboxval = dijit.byId("simpTAtext").value; |
| 456 |
outputval = dijit.byId("simpTAoutput").value; |
| 457 |
if (wid) { |
| 458 |
doh.is("7",wid.get('value'),"wid.get('value') should be set"); |
| 459 |
doh.is(textboxval,wid.get('value'),"wid.get('value') should be set same as textboxval"); |
| 460 |
doh.is(outputval,wid.get('value'),"wid.get('value') should be set same as outputval"); |
| 461 |
} |
| 462 |
// Test dijit.form.Textarea |
| 463 |
wid = dijit.byId("textareasel"); |
| 464 |
textboxval = dijit.byId("textareatext").value; |
| 465 |
outputval = dijit.byId("textareaoutput").value; |
| 466 |
if (wid) { |
| 467 |
doh.is("8",wid.get('value'),"wid.get('value') should be set"); |
| 468 |
doh.is(textboxval,wid.get('value'),"wid.get('value') should be set same as textboxval"); |
| 469 |
doh.is(outputval,wid.get('value'),"wid.get('value') should be set same as outputval"); |
| 470 |
} |
| 471 |
|
| 472 |
|
| 473 |
} |
| 474 |
} |
| 475 |
]); |
| 476 |
|
| 477 |
// should be able to verify all of the inputs |
| 478 |
doh.register("Check initial declarative values and bindings", [ |
| 479 |
{ |
| 480 |
name: "initial-declarative", |
| 481 |
runTest: function(){ |
| 482 |
var wid, textboxval, outputval; |
| 483 |
// Test Select |
| 484 |
wid = dijit.byId("decsel"); |
| 485 |
textboxval = dijit.byId("decseltext").value; |
| 486 |
outputval = dijit.byId("decselOutput").value; |
| 487 |
if (wid) { |
| 488 |
doh.is("1",wid.get('value'),"wid.get('value') should be set"); |
| 489 |
doh.is(textboxval,wid.get('value'),"wid.get('value') should be set same as textboxval"); |
| 490 |
doh.is(outputval,wid.get('value'),"wid.get('value') should be set same as outputval"); |
| 491 |
} |
| 492 |
// Test FilteringSelect |
| 493 |
wid = dijit.byId("decfilsel"); |
| 494 |
textboxval = dijit.byId("decfiltext").value; |
| 495 |
outputval = dijit.byId("decfilOutput").value; |
| 496 |
if (wid) { |
| 497 |
doh.is("2",wid.get('value'),"wid.get('value') should be set"); |
| 498 |
doh.is("two",wid.displayedValue,"wid.displayedValue should be set"); |
| 499 |
doh.is(textboxval,wid.get('value'),"wid.get('value') should be set same as textboxval"); |
| 500 |
doh.is(outputval,wid.get('value'),"wid.get('value') should be set same as outputval"); |
| 501 |
} |
| 502 |
// Test dijit.form.ComboBox |
| 503 |
wid = dijit.byId("deccombosel"); |
| 504 |
textboxval = dijit.byId("deccombotext").value; |
| 505 |
outputval = dijit.byId("deccomboOutput").value; |
| 506 |
if (wid) { |
| 507 |
doh.is("three",wid.get('value'),"wid.get('value') should be set"); |
| 508 |
doh.is("three",wid.displayedValue,"wid.displayedValue should be set"); |
| 509 |
doh.is(textboxval,wid.get('value'),"wid.get('value') should be set same as textboxval"); |
| 510 |
doh.is(outputval,wid.get('value'),"wid.get('value') should be set same as outputval"); |
| 511 |
} |
| 512 |
// Test dijit.form.DateTextBox |
| 513 |
wid = dijit.byId("decdatesel"); |
| 514 |
textboxval = dijit.byId("decdatetext").displayedValue; |
| 515 |
outputval = dijit.byId("decdateOutput").value; |
| 516 |
if (wid) { |
| 517 |
var date = new Date(2011, 3, 4, 0, 0, 0, 0); |
| 518 |
doh.t(wid.get("value").getTime() == date.getTime(), "wid.get(\"value\") should be set to:" + date); |
| 519 |
doh.is("04-04-2011",wid.displayedValue,"wid.displayedValue should be set it is:"+wid.displayedValue); |
| 520 |
doh.is("04-04-2011",textboxval,"textboxval should be set it is:"+textboxval); |
| 521 |
doh.t(outputval.getTime() == date.getTime(), "outputval should be set to:" + date); |
| 522 |
} |
| 523 |
// Test dijit.form.HorizontalSlider |
| 524 |
wid = dijit.byId("decslidersel"); |
| 525 |
textboxval = dijit.byId("decslidertext").value; |
| 526 |
outputval = dijit.byId("decsliderOutput").value; |
| 527 |
if (wid) { |
| 528 |
doh.is("5",wid.get('value'),"wid.get('value') should be set"); |
| 529 |
//doh.is("five",wid.displayedValue,"wid.displayedValue should be set"); |
| 530 |
doh.is(textboxval,wid.get('value'),"wid.get('value') should be set same as textboxval"); |
| 531 |
doh.is(outputval,wid.get('value'),"wid.get('value') should be set same as outputval"); |
| 532 |
} |
| 533 |
// Test dijit.form.NumberSpinner |
| 534 |
wid = dijit.byId("decnumspinsel"); |
| 535 |
textboxval = dijit.byId("decnumspintext").value; |
| 536 |
outputval = dijit.byId("decnumspinOutput").value; |
| 537 |
if (wid) { |
| 538 |
//doh.is("6",wid.get('value'),"wid.get('value') should be set"); |
| 539 |
doh.is("6",wid.displayedValue,"wid.displayedValue should be set"); |
| 540 |
doh.is(textboxval,wid.displayedValue,"wid.displayedValue should be set same as textboxval"); |
| 541 |
doh.is(outputval,wid.displayedValue,"wid.displayedValue should be set same as outputval"); |
| 542 |
} |
| 543 |
// Test dijit.form.SimpleTextarea |
| 544 |
wid = dijit.byId("decsimpTAsel"); |
| 545 |
textboxval = dijit.byId("decsimpTAtext").value; |
| 546 |
outputval = dijit.byId("decsimpTAOutput").value; |
| 547 |
if (wid) { |
| 548 |
doh.is("7",wid.get('value'),"wid.get('value') should be set"); |
| 549 |
doh.is(textboxval,wid.get('value'),"wid.get('value') should be set same as textboxval"); |
| 550 |
doh.is(outputval,wid.get('value'),"wid.get('value') should be set same as outputval"); |
| 551 |
} |
| 552 |
// Test dijit.form.Textarea |
| 553 |
wid = dijit.byId("dectextareasel"); |
| 554 |
textboxval = dijit.byId("dectextareatext").value; |
| 555 |
outputval = dijit.byId("dectextareaOutput").value; |
| 556 |
if (wid) { |
| 557 |
doh.is("8",wid.get('value'),"wid.get('value') should be set"); |
| 558 |
doh.is(textboxval,wid.get('value'),"wid.get('value') should be set same as textboxval"); |
| 559 |
doh.is(outputval,wid.get('value'),"wid.get('value') should be set same as outputval"); |
| 560 |
} |
| 561 |
|
| 562 |
|
| 563 |
} |
| 564 |
} |
| 565 |
]); |
| 566 |
|
| 567 |
// should be able to verify all of the inputs |
| 568 |
doh.register("Check initial calendar and colorpalette values", [ |
| 569 |
{ |
| 570 |
name: "test-calendar-and-color", |
| 571 |
runTest: function(){ |
| 572 |
var wid, textboxval, outputval; |
| 573 |
// Test Calendar |
| 574 |
wid = dijit.byId("deccal"); |
| 575 |
textboxval = dijit.byId("deccaltext").value; |
| 576 |
outputval = dijit.byId("deccalOutput").value; |
| 577 |
if (wid) { |
| 578 |
var date = new Date(2011, 4, 4, 0, 0, 0, 0); |
| 579 |
doh.t(wid.get("value").getTime() == date.getTime(), "wid.get(\"value\") should be set to:" + date); |
| 580 |
doh.t(textboxval.getTime() == date.getTime(), "1-textboxval should be set to:" + date); |
| 581 |
doh.t(outputval.getTime() == date.getTime(), "1-outputval should be set to:" + date); |
| 582 |
} |
| 583 |
// Test dijit.ColorPalette |
| 584 |
wid = dijit.byId("deccolor"); |
| 585 |
textboxval = dijit.byId("deccolortext").value; |
| 586 |
outputval = dijit.byId("deccolorOutput").value; |
| 587 |
if (wid) { |
| 588 |
doh.is("#000000",wid.get('value'),"wid.get('value') should be set"); |
| 589 |
doh.is(textboxval,wid.get('value'),"wid.get('value') should be set same as textboxval"); |
| 590 |
doh.is(outputval,wid.get('value'),"wid.get('value') should be set same as outputval"); |
| 591 |
} |
| 592 |
} |
| 593 |
} |
| 594 |
]); |
| 595 |
|
| 596 |
doh.register("Check update and reset calendar and colorpalette values", [ |
| 597 |
{ |
| 598 |
name: "test-calendar-and-color", |
| 599 |
runTest: function(){ |
| 600 |
var wid, textboxval, outputval; |
| 601 |
// Test Update calendar |
| 602 |
var d = new Date(2011,10,10); |
| 603 |
wid = dijit.byId("deccal"); |
| 604 |
//wid.set('value', d.toDateString()); |
| 605 |
wid.set('value', d); |
| 606 |
textboxval = dijit.byId("deccaltext").value; |
| 607 |
outputval = dijit.byId("deccalOutput").value; |
| 608 |
if (wid && wid.get('value')) { |
| 609 |
var date1 = new Date(2011, 10, 10, 0, 0, 0, 0); |
| 610 |
var date2 = new Date(2011, 10, 10, 1, 0, 0, 0); |
| 611 |
doh.t(wid.get("value").getTime() == date1.getTime(), "wid.get(\"value\") should be set to:" + date1); |
| 612 |
doh.t(textboxval.getTime() == date2.getTime(), "2-textboxval should be set to:" + date2); |
| 613 |
doh.t(outputval.getTime() == date2.getTime(), "2-outputval should be set to:" + date2); |
| 614 |
} |
| 615 |
|
| 616 |
// Test dijit.ColorPalette |
| 617 |
// update the text field |
| 618 |
dijit.byId('deccolortext').set('value',"#ffffff"); |
| 619 |
wid = dijit.byId("deccolor"); |
| 620 |
textboxval = dijit.byId("deccolortext").value; |
| 621 |
outputval = dijit.byId("deccolorOutput").value; |
| 622 |
if (wid) { |
| 623 |
doh.is("#ffffff",wid.get('value'),"wid.get('value') should be set"); |
| 624 |
doh.is(textboxval,wid.get('value'),"wid.get('value') should be set same as textboxval"); |
| 625 |
doh.is(outputval,wid.get('value'),"wid.get('value') should be set same as outputval"); |
| 626 |
} |
| 627 |
|
| 628 |
// Test Reset Calendar |
| 629 |
button = dijit.byId("deccalReset"); // reset the model |
| 630 |
button.onClick(); |
| 631 |
wid = dijit.byId("deccal"); |
| 632 |
textboxval = dijit.byId("deccaltext").value; |
| 633 |
outputval = dijit.byId("deccalOutput").value; |
| 634 |
if (wid) { |
| 635 |
var date = new Date(2011, 4, 4, 0, 0, 0, 0); |
| 636 |
doh.t(wid.get("value").getTime() == date.getTime(), "wid.get(\"value\") should be set to:" + date); |
| 637 |
doh.t(textboxval.getTime() == date.getTime(), "3-textboxval should be set to:" + date); |
| 638 |
doh.t(outputval.getTime() == date.getTime(), "3-outputval should be set to:" + date); |
| 639 |
} |
| 640 |
// Test reset the dijit.ColorPalette |
| 641 |
button = dijit.byId("deccolorReset"); // reset the model |
| 642 |
button.onClick(); |
| 643 |
wid = dijit.byId("deccolor"); |
| 644 |
textboxval = dijit.byId("deccolortext").value; |
| 645 |
outputval = dijit.byId("deccolorOutput").value; |
| 646 |
if (wid) { |
| 647 |
doh.is("#000000",wid.get('value'),"wid.get('value') should be set"); |
| 648 |
doh.is(textboxval,wid.get('value'),"wid.get('value') should be set same as textboxval"); |
| 649 |
doh.is(outputval,wid.get('value'),"wid.get('value') should be set same as outputval"); |
| 650 |
} |
| 651 |
|
| 652 |
|
| 653 |
|
| 654 |
} |
| 655 |
} |
| 656 |
]); |
| 657 |
|
| 658 |
|
| 659 |
// Update and Test all fields |
| 660 |
doh.register("Test update for all programatic values and bindings", [ |
| 661 |
{ |
| 662 |
name: "update-programatic", |
| 663 |
runTest: function(){ |
| 664 |
// update the text field |
| 665 |
dijit.byId('seltext').set('value',"10"); |
| 666 |
var wid, textboxval, outputval; |
| 667 |
// Test Select |
| 668 |
wid = dijit.byId("sel"); |
| 669 |
textboxval = dijit.byId("seltext").value; |
| 670 |
outputval = dijit.byId("selOutput").value; |
| 671 |
if (wid) { |
| 672 |
doh.is("10",wid.get('value'),"wid.get('value') should be set"); |
| 673 |
doh.is(textboxval,wid.get('value'),"wid.get('value') should be set same as textboxval"); |
| 674 |
doh.is(outputval,wid.get('value'),"wid.get('value') should be set same as outputval"); |
| 675 |
} |
| 676 |
// Test FilteringSelect |
| 677 |
// update the text field |
| 678 |
dijit.byId('filtext').set('value',"10"); |
| 679 |
wid = dijit.byId("filsel"); |
| 680 |
textboxval = dijit.byId("filtext").value; |
| 681 |
outputval = dijit.byId("filoutput").value; |
| 682 |
if (wid) { |
| 683 |
doh.is("10",wid.get('value'),"wid.get('value') should be set"); |
| 684 |
doh.is("ten",wid.displayedValue,"wid.displayedValue should be set"); |
| 685 |
doh.is(textboxval,wid.get('value'),"wid.get('value') should be set same as textboxval"); |
| 686 |
doh.is(outputval,wid.get('value'),"wid.get('value') should be set same as outputval"); |
| 687 |
} |
| 688 |
// Test dijit.form.ComboBox |
| 689 |
dijit.byId('combotext').set('value',"ten"); |
| 690 |
wid = dijit.byId("combosel"); |
| 691 |
textboxval = dijit.byId("combotext").value; |
| 692 |
outputval = dijit.byId("combooutput").value; |
| 693 |
if (wid) { |
| 694 |
doh.is("ten",wid.get('value'),"wid.get('value') should be set"); |
| 695 |
doh.is("ten",wid.displayedValue,"wid.displayedValue should be set"); |
| 696 |
doh.is(textboxval,wid.get('value'),"wid.get('value') should be set same as textboxval"); |
| 697 |
doh.is(outputval,wid.get('value'),"wid.get('value') should be set same as outputval"); |
| 698 |
} |
| 699 |
// Test dijit.form.DateTextBox |
| 700 |
// update the text field |
| 701 |
var d = new Date(2011, 9, 10, 0, 0, 0, 0); |
| 702 |
//wid.set('value', d.toDateString()); //"2011-09-09"); |
| 703 |
//dijit.byId('datetext').set('value',d.toDateString()); |
| 704 |
dijit.byId('datetext').set('value',d); |
| 705 |
wid = dijit.byId("datesel"); |
| 706 |
textboxval = dijit.byId("datetext").value; |
| 707 |
outputval = dijit.byId("dateoutput").value; |
| 708 |
if (wid) { |
| 709 |
var date = new Date(2011, 9, 10, 0, 0, 0, 0); |
| 710 |
doh.t(wid.get("value").getTime() == date.getTime(), "wid.get(\"value\") should be set to:" + date); |
| 711 |
doh.t(textboxval.getTime() == date.getTime(), "2-textboxval should be set to:" + date); |
| 712 |
doh.t(outputval.getTime() == date.getTime(), "2-outputval should be set to:" + date); |
| 713 |
} |
| 714 |
// Test dijit.form.HorizontalSlider |
| 715 |
// update the text field |
| 716 |
dijit.byId('slidertext').set('value',"10"); |
| 717 |
wid = dijit.byId("slidersel"); |
| 718 |
textboxval = dijit.byId("slidertext").value; |
| 719 |
outputval = dijit.byId("slideroutput").value; |
| 720 |
if (wid) { |
| 721 |
doh.is("10",wid.get('value'),"wid.get(value) should be set"); |
| 722 |
//doh.is("five",wid.displayedValue,"wid.displayedValue should be set"); |
| 723 |
doh.is(textboxval,wid.get('value'),"wid.get('value') should be set same as textboxval"); |
| 724 |
doh.is(outputval,wid.get('value'),"wid.get('value') should be set same as outputval"); |
| 725 |
} |
| 726 |
// Test dijit.form.NumberSpinner |
| 727 |
dijit.byId('numspintext').set('value',"10"); |
| 728 |
wid = dijit.byId("numspinsel"); |
| 729 |
textboxval = dijit.byId("numspintext").value; |
| 730 |
outputval = dijit.byId("numspinoutput").value; |
| 731 |
if (wid) { |
| 732 |
doh.is("10",wid.displayedValue,"wid.displayedValue should be set"); |
| 733 |
doh.is(textboxval,wid.displayedValue,"wid.displayedValue should be set same as textboxval"); |
| 734 |
doh.is(outputval,wid.displayedValue,"wid.displayedValue should be set same as outputval"); |
| 735 |
} |
| 736 |
// Test dijit.form.SimpleTextarea |
| 737 |
dijit.byId('simpTAtext').set('value',"10"); |
| 738 |
wid = dijit.byId("simpTAsel"); |
| 739 |
textboxval = dijit.byId("simpTAtext").value; |
| 740 |
outputval = dijit.byId("simpTAoutput").value; |
| 741 |
if (wid) { |
| 742 |
doh.is("10",wid.get('value'),"wid.get('value') should be set"); |
| 743 |
doh.is(textboxval,wid.get('value'),"wid.get('value') should be set same as textboxval"); |
| 744 |
doh.is(outputval,wid.get('value'),"wid.get('value') should be set same as outputval"); |
| 745 |
} |
| 746 |
// Test dijit.form.Textarea |
| 747 |
dijit.byId('textareatext').set('value',"10"); |
| 748 |
wid = dijit.byId("textareasel"); |
| 749 |
textboxval = dijit.byId("textareatext").value; |
| 750 |
outputval = dijit.byId("textareaoutput").value; |
| 751 |
if (wid) { |
| 752 |
doh.is("10",wid.get('value'),"wid.get('value') should be set"); |
| 753 |
doh.is(textboxval,wid.get('value'),"wid.get('value') should be set same as textboxval"); |
| 754 |
doh.is(outputval,wid.get('value'),"wid.get('value') should be set same as outputval"); |
| 755 |
} |
| 756 |
|
| 757 |
|
| 758 |
} |
| 759 |
} |
| 760 |
]); |
| 761 |
|
| 762 |
// Update and Test all fields |
| 763 |
doh.register("Test update for all declarative values and bindings", [ |
| 764 |
{ |
| 765 |
name: "update-declarative", |
| 766 |
runTest: function(){ |
| 767 |
dijit.byId("decsel").set('value',"4"); // update widget value |
| 768 |
var wid, textboxval, outputval; |
| 769 |
// Test Select |
| 770 |
wid = dijit.byId("decsel"); |
| 771 |
textboxval = dijit.byId("decseltext").value; |
| 772 |
outputval = dijit.byId("decselOutput").value; |
| 773 |
if (wid) { |
| 774 |
doh.is("4",wid.get('value'),"wid.get('value') should be set"); |
| 775 |
doh.is(textboxval,wid.get('value'),"wid.get('value') should be set same as textboxval"); |
| 776 |
doh.is(outputval,wid.get('value'),"wid.get('value') should be set same as outputval"); |
| 777 |
} |
| 778 |
// Test FilteringSelect |
| 779 |
wid = dijit.byId("decfilsel"); |
| 780 |
wid.set('value','4'); // update widget value |
| 781 |
textboxval = dijit.byId("decfiltext").value; |
| 782 |
outputval = dijit.byId("decfilOutput").value; |
| 783 |
if (wid) { |
| 784 |
doh.is("4",wid.get('value'),"wid.get('value') should be set"); |
| 785 |
doh.is("four",wid.displayedValue,"wid.displayedValue should be set"); |
| 786 |
doh.is(textboxval,wid.get('value'),"wid.get('value') should be set same as textboxval"); |
| 787 |
doh.is(outputval,wid.get('value'),"wid.get('value') should be set same as outputval"); |
| 788 |
} |
| 789 |
// Test dijit.form.ComboBox |
| 790 |
wid = dijit.byId("deccombosel"); |
| 791 |
wid.set('value',"four"); // update widget value |
| 792 |
textboxval = dijit.byId("deccombotext").value; |
| 793 |
outputval = dijit.byId("deccomboOutput").value; |
| 794 |
if (wid) { |
| 795 |
doh.is("four",wid.get('value'),"wid.get('value') should be set"); |
| 796 |
doh.is("four",wid.displayedValue,"wid.displayedValue should be set"); |
| 797 |
doh.is(textboxval,wid.get('value'),"wid.get('value') should be set same as textboxval"); |
| 798 |
doh.is(outputval,wid.get('value'),"wid.get('value') should be set same as outputval"); |
| 799 |
} |
| 800 |
// Test dijit.form.DateTextBox |
| 801 |
wid = dijit.byId("decdatesel"); |
| 802 |
//var d = new Date(2011,09,09); |
| 803 |
//wid.set('value', d.toDateString()); //"2011-09-09"); |
| 804 |
wid.set('value', "2011-09-09"); |
| 805 |
textboxval = dijit.byId("decdatetext").value; |
| 806 |
outputval = dijit.byId("decdateOutput").value; |
| 807 |
if (wid) { |
| 808 |
var date = new Date(2011, 8, 9, 0, 0, 0, 0); |
| 809 |
doh.t(wid.get("value").getTime() == date.getTime(), "wid.get(\"value\") should be set to:" + date); |
| 810 |
doh.t(textboxval.getTime() == date.getTime(), "2-textboxval should be set to:" + date); |
| 811 |
doh.t(outputval.getTime() == date.getTime(), "2-outputval should be set to:" + date); |
| 812 |
doh.is("09-09-2011",wid.displayedValue,"wid.displayedValue should be set"); |
| 813 |
} |
| 814 |
// Test dijit.form.HorizontalSlider |
| 815 |
wid = dijit.byId("decslidersel"); |
| 816 |
wid.set('value',"4"); // update widget value |
| 817 |
textboxval = dijit.byId("decslidertext").value; |
| 818 |
outputval = dijit.byId("decsliderOutput").value; |
| 819 |
if (wid) { |
| 820 |
doh.is("4",wid.get('value'),"wid.get('value') should be set"); |
| 821 |
doh.is(textboxval,wid.get('value'),"wid.get('value') should be set same as textboxval"); |
| 822 |
doh.is(outputval,wid.get('value'),"wid.get('value') should be set same as outputval"); |
| 823 |
} |
| 824 |
// Test dijit.form.NumberSpinner |
| 825 |
wid = dijit.byId("decnumspinsel"); |
| 826 |
wid.set('displayedValue',"4"); // update widget value |
| 827 |
textboxval = dijit.byId("decnumspintext").value; |
| 828 |
outputval = dijit.byId("decnumspinOutput").value; |
| 829 |
if (wid) { |
| 830 |
doh.is("4",wid.displayedValue,"wid.displayedValue should be set"); |
| 831 |
doh.is(textboxval,wid.displayedValue,"wid.displayedValue should be set same as textboxval"); |
| 832 |
doh.is(outputval,wid.displayedValue,"wid.displayedValue should be set same as outputval"); |
| 833 |
} |
| 834 |
// Test dijit.form.SimpleTextarea |
| 835 |
wid = dijit.byId("decsimpTAsel"); |
| 836 |
wid.set('value',"4"); // update widget value |
| 837 |
textboxval = dijit.byId("decsimpTAtext").value; |
| 838 |
outputval = dijit.byId("decsimpTAOutput").value; |
| 839 |
if (wid) { |
| 840 |
doh.is("4",wid.get('value'),"wid.get('value') should be set"); |
| 841 |
doh.is(textboxval,wid.get('value'),"wid.get('value') should be set same as textboxval"); |
| 842 |
doh.is(outputval,wid.get('value'),"wid.get('value') should be set same as outputval"); |
| 843 |
} |
| 844 |
// Test dijit.form.Textarea |
| 845 |
wid = dijit.byId("dectextareasel"); |
| 846 |
wid.set('value',"4"); // update widget value |
| 847 |
textboxval = dijit.byId("dectextareatext").value; |
| 848 |
outputval = dijit.byId("dectextareaOutput").value; |
| 849 |
if (wid) { |
| 850 |
doh.is("4",wid.get('value'),"wid.get('value') should be set"); |
| 851 |
doh.is(textboxval,wid.get('value'),"wid.get('value') should be set same as textboxval"); |
| 852 |
doh.is(outputval,wid.get('value'),"wid.get('value') should be set same as outputval"); |
| 853 |
} |
| 854 |
|
| 855 |
|
| 856 |
} |
| 857 |
} |
| 858 |
]); |
| 859 |
|
| 860 |
|
| 861 |
|
| 862 |
|
| 863 |
// Test RESET for all fields |
| 864 |
doh.register("Test reset for all programatic values and bindings", [ |
| 865 |
{ |
| 866 |
name: "reset-programatic", |
| 867 |
runTest: function(){ |
| 868 |
// reset the model |
| 869 |
var button = dijit.byId("selReset"); |
| 870 |
button.onClick(); |
| 871 |
var wid, textboxval, outputval; |
| 872 |
// Test Select |
| 873 |
wid = dijit.byId("sel"); |
| 874 |
textboxval = dijit.byId("seltext").value; |
| 875 |
outputval = dijit.byId("selOutput").value; |
| 876 |
if (wid) { |
| 877 |
doh.is("1",wid.get('value'),"wid.get('value') should be set"); |
| 878 |
doh.is(textboxval,wid.get('value'),"wid.get('value') should be set same as textboxval"); |
| 879 |
doh.is(outputval,wid.get('value'),"wid.get('value') should be set same as outputval"); |
| 880 |
} |
| 881 |
// Test FilteringSelect |
| 882 |
button = dijit.byId("filReset"); |
| 883 |
button.onClick(); |
| 884 |
wid = dijit.byId("filsel"); |
| 885 |
textboxval = dijit.byId("filtext").value; |
| 886 |
outputval = dijit.byId("filoutput").value; |
| 887 |
if (wid) { |
| 888 |
doh.is("2",wid.get('value'),"wid.get('value') should be set"); |
| 889 |
doh.is("two",wid.displayedValue,"wid.displayedValue should be set"); |
| 890 |
doh.is(textboxval,wid.get('value'),"wid.get('value') should be set same as textboxval"); |
| 891 |
doh.is(outputval,wid.get('value'),"wid.get('value') should be set same as outputval"); |
| 892 |
} |
| 893 |
// Test dijit.form.ComboBox |
| 894 |
button = dijit.byId("comboReset"); |
| 895 |
button.onClick(); |
| 896 |
wid = dijit.byId("combosel"); |
| 897 |
textboxval = dijit.byId("combotext").value; |
| 898 |
outputval = dijit.byId("combooutput").value; |
| 899 |
if (wid) { |
| 900 |
doh.is("three",wid.get('value'),"wid.get('value') should be set"); |
| 901 |
doh.is("three",wid.displayedValue,"wid.displayedValue should be set"); |
| 902 |
doh.is(textboxval,wid.get('value'),"wid.get('value') should be set same as textboxval"); |
| 903 |
doh.is(outputval,wid.get('value'),"wid.get('value') should be set same as outputval"); |
| 904 |
} |
| 905 |
// Test dijit.form.DateTextBox |
| 906 |
button = dijit.byId("dateReset"); |
| 907 |
button.onClick(); |
| 908 |
wid = dijit.byId("datesel"); |
| 909 |
textboxval = dijit.byId("datetext").value; |
| 910 |
outputval = dijit.byId("dateoutput").value; |
| 911 |
if (wid) { |
| 912 |
var date = new Date(2011, 3, 4, 0, 0, 0, 0); |
| 913 |
doh.t(textboxval.getTime() == date.getTime(), "textboxval should be set to:" + date); |
| 914 |
doh.t(outputval.getTime() == date.getTime(), "outputval should be set to:" + date); |
| 915 |
} |
| 916 |
// test a second reset... |
| 917 |
button.onClick(); |
| 918 |
if (wid) { |
| 919 |
var date = new Date(2011, 3, 4, 0, 0, 0, 0); |
| 920 |
doh.t(wid.get("value").getTime() == date.getTime(), "wid.get(\"value\") should be set to:" + date); |
| 921 |
doh.t(textboxval.getTime() == date.getTime(), "2-textboxval should be set to:" + date); |
| 922 |
doh.t(outputval.getTime() == date.getTime(), "2-outputval should be set to:" + date); |
| 923 |
doh.is("04-04-2011",wid.displayedValue,"wid.displayedValue should be set"); |
| 924 |
} |
| 925 |
// Test dijit.form.HorizontalSlider |
| 926 |
button = dijit.byId("sliderReset"); |
| 927 |
button.onClick(); |
| 928 |
wid = dijit.byId("slidersel"); |
| 929 |
textboxval = dijit.byId("slidertext").value; |
| 930 |
outputval = dijit.byId("slideroutput").value; |
| 931 |
if (wid) { |
| 932 |
doh.is("5",wid.get('value'),"wid.get('value') should be set"); |
| 933 |
//doh.is("five",wid.displayedValue,"wid.displayedValue should be set"); |
| 934 |
doh.is(textboxval,wid.get('value'),"wid.get('value') should be set same as textboxval"); |
| 935 |
doh.is(outputval,wid.get('value'),"wid.get('value') should be set same as outputval"); |
| 936 |
} |
| 937 |
// Test dijit.form.NumberSpinner |
| 938 |
button = dijit.byId("numspinReset"); |
| 939 |
button.onClick(); |
| 940 |
wid = dijit.byId("numspinsel"); |
| 941 |
textboxval = dijit.byId("numspintext").value; |
| 942 |
outputval = dijit.byId("numspinoutput").value; |
| 943 |
if (wid) { |
| 944 |
doh.is("6",wid.displayedValue,"wid.displayedValue should be set"); |
| 945 |
doh.is(textboxval,wid.displayedValue,"wid.displayedValue should be set same as textboxval"); |
| 946 |
doh.is(outputval,wid.displayedValue,"wid.displayedValue should be set same as outputval"); |
| 947 |
} |
| 948 |
// Test dijit.form.SimpleTextarea |
| 949 |
button = dijit.byId("simpTAReset"); |
| 950 |
button.onClick(); |
| 951 |
wid = dijit.byId("simpTAsel"); |
| 952 |
textboxval = dijit.byId("simpTAtext").value; |
| 953 |
outputval = dijit.byId("simpTAoutput").value; |
| 954 |
if (wid) { |
| 955 |
doh.is("7",wid.get('value'),"wid.get('value') should be set"); |
| 956 |
doh.is(textboxval,wid.get('value'),"wid.get('value') should be set same as textboxval"); |
| 957 |
doh.is(outputval,wid.get('value'),"wid.get('value') should be set same as outputval"); |
| 958 |
} |
| 959 |
// Test dijit.form.Textarea |
| 960 |
button = dijit.byId("textareaReset"); |
| 961 |
button.onClick(); |
| 962 |
wid = dijit.byId("textareasel"); |
| 963 |
textboxval = dijit.byId("textareatext").value; |
| 964 |
outputval = dijit.byId("textareaoutput").value; |
| 965 |
if (wid) { |
| 966 |
doh.is("8",wid.get('value'),"wid.get('value') should be set"); |
| 967 |
doh.is(textboxval,wid.get('value'),"wid.get('value') should be set same as textboxval"); |
| 968 |
doh.is(outputval,wid.get('value'),"wid.get('value') should be set same as outputval"); |
| 969 |
} |
| 970 |
|
| 971 |
|
| 972 |
} |
| 973 |
} |
| 974 |
]); |
| 975 |
|
| 976 |
// Test reset all declarative |
| 977 |
doh.register("Test Reset all declarative values and bindings", [ |
| 978 |
{ |
| 979 |
name: "reset-declarative", |
| 980 |
runTest: function(){ |
| 981 |
var button = dijit.byId("decselReset"); // reset the model |
| 982 |
button.onClick(); |
| 983 |
var wid, textboxval, outputval; |
| 984 |
// Test Select |
| 985 |
wid = dijit.byId("decsel"); |
| 986 |
textboxval = dijit.byId("decseltext").value; |
| 987 |
outputval = dijit.byId("decselOutput").value; |
| 988 |
if (wid) { |
| 989 |
doh.is("1",wid.get('value'),"wid.get('value') should be set"); |
| 990 |
doh.is(textboxval,wid.get('value'),"wid.get('value') should be set same as textboxval"); |
| 991 |
doh.is(outputval,wid.get('value'),"wid.get('value') should be set same as outputval"); |
| 992 |
} |
| 993 |
// Test FilteringSelect |
| 994 |
button = dijit.byId("decfilReset"); // reset the model |
| 995 |
button.onClick(); |
| 996 |
wid = dijit.byId("decfilsel"); |
| 997 |
textboxval = dijit.byId("decfiltext").value; |
| 998 |
outputval = dijit.byId("decfilOutput").value; |
| 999 |
if (wid) { |
| 1000 |
doh.is("2",wid.get('value'),"wid.get('value') should be set"); |
| 1001 |
doh.is("two",wid.displayedValue,"wid.displayedValue should be set"); |
| 1002 |
doh.is(textboxval,wid.get('value'),"wid.get('value') should be set same as textboxval"); |
| 1003 |
doh.is(outputval,wid.get('value'),"wid.get('value') should be set same as outputval"); |
| 1004 |
} |
| 1005 |
// Test dijit.form.ComboBox |
| 1006 |
button = dijit.byId("deccomboReset"); // reset the model |
| 1007 |
button.onClick(); |
| 1008 |
wid = dijit.byId("deccombosel"); |
| 1009 |
textboxval = dijit.byId("deccombotext").value; |
| 1010 |
outputval = dijit.byId("deccomboOutput").value; |
| 1011 |
if (wid) { |
| 1012 |
doh.is("three",wid.get('value'),"wid.get('value') should be set"); |
| 1013 |
doh.is("three",wid.displayedValue,"wid.displayedValue should be set"); |
| 1014 |
doh.is(textboxval,wid.get('value'),"wid.get('value') should be set same as textboxval"); |
| 1015 |
doh.is(outputval,wid.get('value'),"wid.get('value') should be set same as outputval"); |
| 1016 |
} |
| 1017 |
// Test dijit.form.DateTextBox |
| 1018 |
button = dijit.byId("decdateReset"); // reset the model |
| 1019 |
button.onClick(); |
| 1020 |
wid = dijit.byId("decdatesel"); |
| 1021 |
textboxval = dijit.byId("decdatetext").displayedValue; |
| 1022 |
outputval = dijit.byId("decdateOutput").value; |
| 1023 |
if (wid) { |
| 1024 |
var date = new Date(2011, 3, 4, 0, 0, 0, 0); |
| 1025 |
doh.t(wid.get("value").getTime() == date.getTime(), "wid.get(\"value\") should be set to:" + date); |
| 1026 |
doh.is("04-04-2011",wid.displayedValue,"wid.displayedValue should be set"); |
| 1027 |
doh.is("04-04-2011",textboxval,"textboxval should be set"); |
| 1028 |
outputval = dijit.byId("decdateOutput").value; |
| 1029 |
doh.t(outputval.getTime() == date.getTime(), "outputval should be set to:" + date); |
| 1030 |
} |
| 1031 |
// Test dijit.form.HorizontalSlider |
| 1032 |
button = dijit.byId("decsliderReset"); // reset the model |
| 1033 |
button.onClick(); |
| 1034 |
wid = dijit.byId("decslidersel"); |
| 1035 |
textboxval = dijit.byId("decslidertext").value; |
| 1036 |
outputval = dijit.byId("decsliderOutput").value; |
| 1037 |
if (wid) { |
| 1038 |
doh.is("5",wid.get('value'),"wid.get('value') should be set"); |
| 1039 |
//doh.is("five",wid.displayedValue,"wid.displayedValue should be set"); |
| 1040 |
doh.is(textboxval,wid.get('value'),"wid.get('value') should be set same as textboxval"); |
| 1041 |
doh.is(outputval,wid.get('value'),"wid.get('value') should be set same as outputval"); |
| 1042 |
} |
| 1043 |
// Test dijit.form.NumberSpinner |
| 1044 |
button = dijit.byId("decnumspinReset"); // reset the model |
| 1045 |
button.onClick(); |
| 1046 |
wid = dijit.byId("decnumspinsel"); |
| 1047 |
textboxval = dijit.byId("decnumspintext").value; |
| 1048 |
outputval = dijit.byId("decnumspinOutput").value; |
| 1049 |
if (wid) { |
| 1050 |
//doh.is("6",wid.get('value'),"wid.get('value') should be set"); |
| 1051 |
doh.is("6",wid.displayedValue,"wid.displayedValue should be set"); |
| 1052 |
doh.is(textboxval,wid.displayedValue,"wid.displayedValue should be set same as textboxval"); |
| 1053 |
doh.is(outputval,wid.displayedValue,"wid.displayedValue should be set same as outputval"); |
| 1054 |
} |
| 1055 |
// Test dijit.form.SimpleTextarea |
| 1056 |
button = dijit.byId("decsimpTAReset"); // reset the model |
| 1057 |
button.onClick(); |
| 1058 |
wid = dijit.byId("decsimpTAsel"); |
| 1059 |
textboxval = dijit.byId("decsimpTAtext").value; |
| 1060 |
outputval = dijit.byId("decsimpTAOutput").value; |
| 1061 |
if (wid) { |
| 1062 |
doh.is("7",wid.get('value'),"wid.get('value') should be set"); |
| 1063 |
doh.is(textboxval,wid.get('value'),"wid.get('value') should be set same as textboxval"); |
| 1064 |
doh.is(outputval,wid.get('value'),"wid.get('value') should be set same as outputval"); |
| 1065 |
} |
| 1066 |
// Test dijit.form.Textarea |
| 1067 |
button = dijit.byId("dectextareaReset"); // reset the model |
| 1068 |
button.onClick(); |
| 1069 |
wid = dijit.byId("dectextareasel"); |
| 1070 |
textboxval = dijit.byId("dectextareatext").value; |
| 1071 |
outputval = dijit.byId("dectextareaOutput").value; |
| 1072 |
if (wid) { |
| 1073 |
doh.is("8",wid.get('value'),"wid.get('value') should be set"); |
| 1074 |
doh.is(textboxval,wid.get('value'),"wid.get('value') should be set same as textboxval"); |
| 1075 |
doh.is(outputval,wid.get('value'),"wid.get('value') should be set same as outputval"); |
| 1076 |
} |
| 1077 |
|
| 1078 |
} |
| 1079 |
} |
| 1080 |
]); |
| 1081 |
|
| 1082 |
|
| 1083 |
// Test reset all declarative |
| 1084 |
doh.register("Test NaN values and bindings", [ |
| 1085 |
{ |
| 1086 |
name: "NaN-test", |
| 1087 |
runTest: function(){ |
| 1088 |
var button = dijit.byId("decselReset"); // reset the model |
| 1089 |
button.onClick(); |
| 1090 |
var wid, wid2; |
| 1091 |
|
| 1092 |
// test for NaN stuff here, uses nanmodel, without fix for ticket 14190 FF crashes |
| 1093 |
wid = dijit.byId("nannb"); |
| 1094 |
wid.focus(); |
| 1095 |
wid2 = dijit.byId("textareatext"); |
| 1096 |
wid2.focus(); |
| 1097 |
wid = dijit.byId("nannb"); |
| 1098 |
wid.focus(); |
| 1099 |
wid2.focus(); |
| 1100 |
if (wid) { |
| 1101 |
doh.t(isNaN(wid.get('value')),"isNaN(wid.get('value') should be true"); |
| 1102 |
} |
| 1103 |
|
| 1104 |
} |
| 1105 |
} |
| 1106 |
]); |
| 1107 |
|
| 1108 |
doh.run(); |
| 1109 |
|
| 1110 |
}); |
| 1111 |
</script> |
| 1112 |
</head> |
| 1113 |
<body class="claro"> |
| 1114 |
<div id="wrapper"> |
| 1115 |
<div id="header" style="margin-top: 0px;"> |
| 1116 |
<div id="navigation" style="margin-top: 0px;"></div> |
| 1117 |
<div id="headerInsert" style="margin-top: 0px;"> |
| 1118 |
<h2>Data-bound Form Element Kitchen Sink MVC test</h2> |
| 1119 |
</div> |
| 1120 |
</div> |
| 1121 |
<div id="main" style="margin-top: 0px;"> |
| 1122 |
<div id="leftNav"></div> |
| 1123 |
<div id="mainContent"> |
| 1124 |
|
| 1125 |
<h2 style="margin-top: 0px;">Programmatic creation of Form elements:</h2> |
| 1126 |
<table> |
| 1127 |
<tbody> |
| 1128 |
<tr> |
| 1129 |
<td><label>Widget</label></td> |
| 1130 |
<td><label></label></td> |
| 1131 |
<td><label>Textbox</label></td> |
| 1132 |
<td><label>Output</label></td> |
| 1133 |
<td><label>Model Reset</label></td> |
| 1134 |
</tr> |
| 1135 |
<tr> |
| 1136 |
<td><label for="sel">Select:</label></td> |
| 1137 |
<td><div id="sel"></div></td> |
| 1138 |
<td><div id="seltext"></div></td> |
| 1139 |
<td><div id="selOutput"></div></td> |
| 1140 |
<td><div id="reset1" ></div></td> |
| 1141 |
</tr> |
| 1142 |
<tr> |
| 1143 |
<td><label for="filsel">FilteringSelect:</label></td> |
| 1144 |
<td><div id="filsel"></div></td> |
| 1145 |
<td><div id="filtext"></div></td> |
| 1146 |
<td><div id="filoutput"></div></td> |
| 1147 |
<td><div id="filreset"></div></td> |
| 1148 |
</tr> |
| 1149 |
<tr> |
| 1150 |
<td><label for="combosel">ComboBox:</label></td> |
| 1151 |
<td><div id="combosel"></div></td> |
| 1152 |
<td><div id="combotext"></div></td> |
| 1153 |
<td><div id="combooutput"></div></td> |
| 1154 |
<td><div id="comboreset"></div></td> |
| 1155 |
</tr> |
| 1156 |
<tr> |
| 1157 |
<td><label for="datesel">DateTextBox:</label></td> |
| 1158 |
<td><div id="datesel"></div></td> |
| 1159 |
<td><div id="datetext"></div></td> |
| 1160 |
<td><div id="dateoutput"></div></td> |
| 1161 |
<td><div id="datereset"></div></td> |
| 1162 |
</tr> |
| 1163 |
<tr> |
| 1164 |
<td><label for="slidersel">Slider:</label></td> |
| 1165 |
<td><div id="slidersel"></div></td> |
| 1166 |
<td><div id="slidertext"></div></td> |
| 1167 |
<td><div id="slideroutput"></div></td> |
| 1168 |
<td><div id="sliderreset"></div></td> |
| 1169 |
</tr> |
| 1170 |
<tr> |
| 1171 |
<td><label for="numspinsel">NumberSpinner:</label></td> |
| 1172 |
<td><div id="numspinsel"></div></td> |
| 1173 |
<td><div id="numspintext"></div></td> |
| 1174 |
<td><div id="numspinoutput"></div></td> |
| 1175 |
<td><div id="numspinreset"></div></td> |
| 1176 |
</tr> |
| 1177 |
<tr> |
| 1178 |
<td><label for="simpTAsel">SimpleTextArea:</label></td> |
| 1179 |
<td><div id="simpTAsel"></div></td> |
| 1180 |
<td><div id="simpTAtext"></div></td> |
| 1181 |
<td><div id="simpTAoutput"></div></td> |
| 1182 |
<td><div id="simpTAreset"></div></td> |
| 1183 |
</tr> |
| 1184 |
<tr> |
| 1185 |
<td><label for="textareasel">TextArea:</label></td> |
| 1186 |
<td><div id="textareasel"></div></td> |
| 1187 |
<td><div id="textareatext"></div></td> |
| 1188 |
<td><div id="textareaoutput"></div></td> |
| 1189 |
<td><div id="textareareset"></div></td> |
| 1190 |
</tr> |
| 1191 |
<tr> |
| 1192 |
<td><label for="nannb">TextBox nan test:</label></td> |
| 1193 |
<td><div id="nannb"></div></td> |
| 1194 |
</tr> |
| 1195 |
</tbody> |
| 1196 |
</table> |
| 1197 |
|
| 1198 |
<h2>Declarative creation of Form elements:</h2> |
| 1199 |
<table> |
| 1200 |
<tbody> |
| 1201 |
<tr> |
| 1202 |
<td><label>Widget</label></td> |
| 1203 |
<td><label></label></td> |
| 1204 |
<td><label>Textbox</label></td> |
| 1205 |
<td><label>Output</label></td> |
| 1206 |
<td><label>Model Reset</label></td> |
| 1207 |
</tr> |
| 1208 |
<tr> |
| 1209 |
<td><label for="decsel">Select:</label></td> |
| 1210 |
<td> |
| 1211 |
<select id="decsel" style="width: 188px;" |
| 1212 |
data-dojo-id="decsel" data-dojo-type="dijit.form.Select" |
| 1213 |
data-dojo-props='name:"decsel", ref: decselmodel.number '> |
| 1214 |
<option value="1">one</option> |
| 1215 |
<option value="2">two</option> |
| 1216 |
<option value="3">three</option> |
| 1217 |
<option value="4">four</option> |
| 1218 |
</select> |
| 1219 |
</td> |
| 1220 |
<td> |
| 1221 |
<input class="cell" id="decseltext" data-dojo-type="dijit.form.TextBox" |
| 1222 |
data-dojo-props="ref: decselmodel.number"></input> |
| 1223 |
</td> |
| 1224 |
<td><span id="decselOutput" data-dojo-type="dojox.mvc.Output" |
| 1225 |
data-dojo-props="ref: decselmodel.number"> |
| 1226 |
${this.value} |
| 1227 |
</span></td> |
| 1228 |
<td><button id="decselReset" type="button" data-dojo-type="dijit.form.Button" |
| 1229 |
data-dojo-props="onClick: function(){decselmodel.reset();}">Reset</button></td> |
| 1230 |
</tr> |
| 1231 |
<tr> |
| 1232 |
<td><label for="decfilsel">FilteringSelect:</label></td> |
| 1233 |
<td> |
| 1234 |
<input id="decfilsel" data-dojo-type="dijit.form.FilteringSelect" |
| 1235 |
data-dojo-props='store:store, ref: decfilmodel.number'/> |
| 1236 |
</td> |
| 1237 |
<td> |
| 1238 |
<input id="decfiltext" data-dojo-type="dijit.form.TextBox" |
| 1239 |
data-dojo-props="ref: decfilmodel.number"></input> |
| 1240 |
</td> |
| 1241 |
<td><span id="decfilOutput" data-dojo-type="dojox.mvc.Output" |
| 1242 |
data-dojo-props="ref: decfilmodel.number"> |
| 1243 |
${this.value} |
| 1244 |
</span></td> |
| 1245 |
<td><button id="decfilReset" type="button" data-dojo-type="dijit.form.Button" |
| 1246 |
data-dojo-props="onClick: function(){decfilmodel.reset();}">Reset</button></td> |
| 1247 |
</tr> |
| 1248 |
<tr> |
| 1249 |
<td><label for="deccombosel">ComboBox:</label></td> |
| 1250 |
<td> |
| 1251 |
<input id="deccombosel" data-dojo-type="dijit.form.ComboBox" |
| 1252 |
data-dojo-props='store:store, ref: deccombomodel.number'/> |
| 1253 |
</td> |
| 1254 |
<td> |
| 1255 |
<input id="deccombotext" data-dojo-type="dijit.form.TextBox" |
| 1256 |
data-dojo-props="ref: deccombomodel.number"></input> |
| 1257 |
</td> |
| 1258 |
<td><span id="deccomboOutput" data-dojo-type="dojox.mvc.Output" |
| 1259 |
data-dojo-props="ref: deccombomodel.number"> |
| 1260 |
${this.value} |
| 1261 |
</span></td> |
| 1262 |
<td><button id="deccomboReset" type="button" data-dojo-type="dijit.form.Button" |
| 1263 |
data-dojo-props="onClick: function(){deccombomodel.reset();}">Reset</button></td> |
| 1264 |
</tr> |
| 1265 |
<tr> |
| 1266 |
<td><label for="datesel">DateTextBox:</label></td> |
| 1267 |
<td> |
| 1268 |
<input id="decdatesel" data-dojo-type="dijit.form.DateTextBox" |
| 1269 |
data-dojo-props='store:store, ref: decdatemodel.number, constraints: dummyDateWid.constraints'/> |
| 1270 |
</td> |
| 1271 |
<td> |
| 1272 |
<input id="decdatetext" data-dojo-type="dijit.form.TextBox" |
| 1273 |
data-dojo-props="ref: decdatemodel.number, |
| 1274 |
disabled: true, |
| 1275 |
constraints: dummyDateWid.constraints, |
| 1276 |
dateLocaleModule : dummyDateWid.dateLocaleModule, |
| 1277 |
format : dummyDateWid.format"></input> |
| 1278 |
</td> |
| 1279 |
<td><span id="decdateOutput" data-dojo-type="dojox.mvc.Output" |
| 1280 |
data-dojo-props="ref: decdatemodel.number, constraints: dummyDateWid.constraints"> |
| 1281 |
${this.value} |
| 1282 |
</span></td> |
| 1283 |
<td><button id="decdateReset" type="button" data-dojo-type="dijit.form.Button" |
| 1284 |
data-dojo-props="onClick: function(){decdatemodel.reset();}">Reset</button></td> |
| 1285 |
</tr> |
| 1286 |
<tr> |
| 1287 |
<td><label for="decslidersel">Slider:</label></td> |
| 1288 |
<td> |
| 1289 |
<input id="decslidersel" data-dojo-type="dijit.form.HorizontalSlider" |
| 1290 |
data-dojo-props='store:store, ref: decslidermodel.number, |
| 1291 |
style:{width:"190px"}, minimum:0, maximum:100, discreteValues:21'/> |
| 1292 |
</td> |
| 1293 |
<td> |
| 1294 |
<input id="decslidertext" data-dojo-type="dijit.form.TextBox" |
| 1295 |
data-dojo-props="ref: decslidermodel.number"></input> |
| 1296 |
</td> |
| 1297 |
<td><span id="decsliderOutput" data-dojo-type="dojox.mvc.Output" |
| 1298 |
data-dojo-props="ref: decslidermodel.number"> |
| 1299 |
${this.value} |
| 1300 |
</span></td> |
| 1301 |
<td><button id="decsliderReset" type="button" data-dojo-type="dijit.form.Button" |
| 1302 |
data-dojo-props="onClick: function(){decslidermodel.reset();}">Reset</button></td> |
| 1303 |
</tr> |
| 1304 |
<tr> |
| 1305 |
<td><label for="decnumspinsel">NumberSpinner:</label></td> |
| 1306 |
<td> |
| 1307 |
<input id="decnumspinsel" data-dojo-type="dijit.form.NumberSpinner" |
| 1308 |
data-dojo-props='store:store, ref: decnumspinmodel.number'/> |
| 1309 |
</td> |
| 1310 |
<td> |
| 1311 |
<input id="decnumspintext" data-dojo-type="dijit.form.TextBox" |
| 1312 |
data-dojo-props="ref: decnumspinmodel.number"></input> |
| 1313 |
</td> |
| 1314 |
<td><span id="decnumspinOutput" data-dojo-type="dojox.mvc.Output" |
| 1315 |
data-dojo-props="ref: decnumspinmodel.number"> |
| 1316 |
${this.value} |
| 1317 |
</span></td> |
| 1318 |
<td><button id="decnumspinReset" type="button" data-dojo-type="dijit.form.Button" |
| 1319 |
data-dojo-props="onClick: function(){decnumspinmodel.reset();}">Reset</button></td> |
| 1320 |
</tr> |
| 1321 |
<tr> |
| 1322 |
<td><label for="decsimpTAsel">SimpleTextArea:</label></td> |
| 1323 |
<td> |
| 1324 |
<input id="decsimpTAsel" data-dojo-type="dijit.form.Textarea" |
| 1325 |
data-dojo-props='store:store, ref: decsimpTAmodel.number'/> |
| 1326 |
</td> |
| 1327 |
<td> |
| 1328 |
<input id="decsimpTAtext" data-dojo-type="dijit.form.TextBox" |
| 1329 |
data-dojo-props="ref: decsimpTAmodel.number"/> |
| 1330 |
</td> |
| 1331 |
<td><span id="decsimpTAOutput" data-dojo-type="dojox.mvc.Output" |
| 1332 |
data-dojo-props="ref: decsimpTAmodel.number"> |
| 1333 |
${this.value} |
| 1334 |
</span></td> |
| 1335 |
<td><button id="decsimpTAReset" type="button" data-dojo-type="dijit.form.Button" |
| 1336 |
data-dojo-props="onClick: function(){decsimpTAmodel.reset();}">Reset</button></td> |
| 1337 |
</tr> |
| 1338 |
<tr> |
| 1339 |
<td><label for="dectextareasel">TextArea:</label></td> |
| 1340 |
<td> |
| 1341 |
<input id="dectextareasel" data-dojo-type="dijit.form.Textarea" |
| 1342 |
data-dojo-props='store:store, ref: dectextareamodel.number'/> |
| 1343 |
</td> |
| 1344 |
<td> |
| 1345 |
<input id="dectextareatext" data-dojo-type="dijit.form.TextBox" |
| 1346 |
data-dojo-props="ref: dectextareamodel.number"/> |
| 1347 |
</td> |
| 1348 |
<td><span id="dectextareaOutput" data-dojo-type="dojox.mvc.Output" |
| 1349 |
data-dojo-props="ref: dectextareamodel.number"> |
| 1350 |
${this.value} |
| 1351 |
</span></td> |
| 1352 |
<td><button id="dectextareaReset" type="button" data-dojo-type="dijit.form.Button" |
| 1353 |
data-dojo-props="onClick: function(){dectextareamodel.reset();}">Reset</button></td> |
| 1354 |
</tr> |
| 1355 |
</tbody> |
| 1356 |
</table> |
| 1357 |
|
| 1358 |
<h2>Test data-bound dijit.Calendar:</h2> |
| 1359 |
<table> |
| 1360 |
<tbody> |
| 1361 |
<tr> |
| 1362 |
<td><label>Widget</label></td> |
| 1363 |
<td><label></label></td> |
| 1364 |
<td><label>Textbox</label></td> |
| 1365 |
<td><label>Output</label></td> |
| 1366 |
<td><label>Model Reset</label></td> |
| 1367 |
</tr> |
| 1368 |
<tr> |
| 1369 |
<td><label for="deccal">Calendar:</label></td> |
| 1370 |
<td> |
| 1371 |
<input class="cell" id="deccal" data-dojo-id="deccal" data-dojo-type="dijit.Calendar" |
| 1372 |
data-dojo-props='ref: deccalmodel.date '/> |
| 1373 |
</td> |
| 1374 |
<td> |
| 1375 |
<input class="cell" id="deccaltext" data-dojo-type="dijit.form.TextBox" |
| 1376 |
data-dojo-props="ref: deccalmodel.date"></input> |
| 1377 |
</td> |
| 1378 |
<td><span id="deccalOutput" data-dojo-type="dojox.mvc.Output" |
| 1379 |
data-dojo-props="ref: deccalmodel.date"> |
| 1380 |
${this.value} |
| 1381 |
</span></td> |
| 1382 |
<td><button id="deccalReset" type="button" data-dojo-type="dijit.form.Button" |
| 1383 |
data-dojo-props="onClick: function(){deccalmodel.reset();}">Reset</button></td> |
| 1384 |
</tr> |
| 1385 |
<tr> |
| 1386 |
<td><label for="deccolor">ColorPalette:</label></td> |
| 1387 |
<td> |
| 1388 |
<div id="deccolor" data-dojo-type="dijit.ColorPalette" |
| 1389 |
data-dojo-props='palette:"3x4", ref: deccolormodel.code'></div> |
| 1390 |
</td> |
| 1391 |
<td> |
| 1392 |
<input class="cell" id="deccolortext" data-dojo-type="dijit.form.TextBox" |
| 1393 |
data-dojo-props="ref: deccolormodel.code"></input> |
| 1394 |
</td> |
| 1395 |
<td><span id="deccolorOutput" data-dojo-type="dojox.mvc.Output" |
| 1396 |
data-dojo-props="ref: deccolormodel.code"> |
| 1397 |
${this.value} |
| 1398 |
</span></td> |
| 1399 |
<td><button id="deccolorReset" type="button" data-dojo-type="dijit.form.Button" |
| 1400 |
data-dojo-props="onClick: function(){deccolormodel.reset();}">Reset</button></td> |
| 1401 |
</tr> |
| 1402 |
</tbody> |
| 1403 |
</table> |
| 1404 |
</div> |
| 1405 |
</div> |
| 1406 |
</div> |
| 1407 |
</body> |
| 1408 |
</html> |