Debian Codegraph @

dojox/mvc/tests/1.7/test_async-mvc_input-output-simple.html

raw symbols SCIP
1 <!DOCTYPE html>
2 <html>
3 <head>
4 <meta http-equiv="Content-type" content="text/html; charset=utf-8">
5 <title>Simple Input-Output Data Binding Example</title>
6 <style type="text/css">
7 @import "css/app-format.css";
8 @import "../../../../dijit/themes/claro/claro.css";
9 </style>
10
11 <script type="text/javascript" djConfig="parseOnLoad:0,isDebug:1,async:1" src="../../../../dojo/dojo.js"></script>
12 <script type="text/javascript">
13 var model;
14
15 require([
16 'dojo/parser',
17 'dojo/ready',
18 'dojox/mvc',
19 'dijit/form/TextBox',
20 'dijit/form/Button',
21 'dojox/mvc/Group',
22 'dojox/mvc/Output'
23 ], function(parser, ready, mvc){
24
25 // The dojox.mvc.StatefulModel class creates a data model instance
26 // where each leaf within the data model is decorated with dojo.Stateful
27 // properties that widgets can bind to and watch for their changes.
28 model = mvc.newStatefulModel({ data : { "First" : "John", "Last" : "Doe", "Email" : "[email protected]" }});
29 // the StatefulModel created above is initialized with
30 // model.First set to "John", model.Last set to "Doe" and model.Email set to "[email protected]"
31
32 // when "dojo/ready" is ready call parser.parse
33 ready(function(){
34 parser.parse();
35 });
36 });
37 </script>
38 </head>
39 <body class="claro">
40 <div id="wrapper">
41 <div id="header">
42 <div id="navigation"></div>
43 <div id="headerInsert">
44 <h1>Input Output Sync</h1>
45 <h2>Data Binding Example</h2>
46 </div>
47 </div>
48 <div id="main">
49 <div id="leftNav"></div>
50 <div id="mainContent">
51 <div class="row">
52 <label class="cell" for="firstnameInput">First:</label>
53 <input class="cell" id="firstnameInput" data-dojo-type="dijit.form.TextBox"
54 data-dojo-props="ref: model.First"></input>
55 <!-- Content in output below will always be in sync with value of textbox above -->
56 <span data-dojo-type="dojox.mvc.Output" data-dojo-props="ref: model.First">
57 (first name is: ${this.value})
58 </span>
59 </div>
60 <div class="row">
61 <label class="cell" for="lastnameInput">Last:</label>
62 <input class="cell" id="lastnameInput" data-dojo-type="dijit.form.TextBox"
63 data-dojo-props="ref: model.Last"></input>
64 <span data-dojo-type="dojox.mvc.Output" data-dojo-props="ref: model.Last">
65 (last name is: ${this.value})
66 </span>
67 </div>
68 <div class="row">
69 <label class="cell" for="emailInput">Email:</label>
70 <input class="cell" id="emailInput" data-dojo-type="dijit.form.TextBox"
71 data-dojo-props="ref: model.Email"></input>
72 <span data-dojo-type="dojox.mvc.Output" data-dojo-props="ref: model.Email">
73 (email is: ${this.value})
74 </span>
75 </div>
76 <br/>Model:
77 <button id="reset" type="button" data-dojo-type="dijit.form.Button" data-dojo-props="onClick: function(){model.reset();}">Reset</button>
78 </div>
79 </div>
80 </div>
81 </body>
82 </html>