Debian Codegraph @

dojox/mvc/tests/1.7/test_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>Static Master/Detail Pattern -- Multiple Address Detail example</title>
6 <style type="text/css">
7 @import "css/app-format.css";
8 @import "../../../../dijit/themes/claro/claro.css";
9 .row { width: 500px; display: inline-block; margin: 5px; }
10 .cell { width: 20%; display:inline-block; }
11 .textcell { width: 30%; display:inline-block; }
12 </style>
13 <script type="text/javascript" djConfig="parseOnLoad:1,isDebug:1,async:1" src="../../../../dojo/dojo.js"></script>
14 <script type="text/javascript">
15 var model;
16
17 require([
18 'dojo/parser',
19 'dojox/mvc',
20 'dijit/form/TextBox',
21 'dijit/form/Button',
22 'dojox/mvc/Group',
23 'dojox/mvc/Output'
24 ], function(parser, mvc){
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 </script>
33 </head>
34 <body class="claro">
35 <div id="wrapper">
36 <div id="header">
37 <div id="navigation"></div>
38 <div id="headerInsert">
39 <h1>Input Output Sync</h1>
40 <h2>Data Binding Example</h2>
41 </div>
42 </div>
43 <div id="main">
44 <div id="leftNav"></div>
45 <div id="mainContent">
46 <div class="row">
47 <label class="cell" for="firstId">First:</label>
48 <input class="textcell" id="firstId" data-dojo-type="dijit.form.TextBox"
49 data-dojo-props="ref: model.First"></input>
50 <!-- Content in output below will always be in sync with value of textbox above -->
51 <span data-dojo-type="dojox.mvc.Output" data-dojo-props="ref: model.First">
52 (first name is: ${this.value})
53 </span>
54 </div>
55 <div class="row">
56 <label class="cell" for="lastnameInput">Last:</label>
57 <input class="textcell" id="lastnameInput" data-dojo-type="dijit.form.TextBox"
58 data-dojo-props="ref: model.Last"></input>
59 <span data-dojo-type="dojox.mvc.Output" data-dojo-props="ref: model.Last">
60 (last name is: ${this.value})
61 </span>
62 </div>
63 <div class="row">
64 <label class="cell" for="emailInput">Email:</label>
65 <input class="textcell" id="emailInput" data-dojo-type="dijit.form.TextBox"
66 data-dojo-props="ref: model.Email"></input>
67 <span data-dojo-type="dojox.mvc.Output" data-dojo-props="ref: model.Email">
68 (email is: ${this.value})
69 </span>
70 </div>
71 <br/>Model:
72 <button id="reset" type="button" data-dojo-type="dijit.form.Button"
73 data-dojo-props="onClick: function(){model.reset();}">Reset</button>
74 <button id="fromModel" type="button" data-dojo-type="dijit.form.Button"
75 data-dojo-props="onClick:
76 function(){model.First.set('value','Updated in Model');}">Update First from Model</button>
77 <button id="fromWidget" type="button" data-dojo-type="dijit.form.Button"
78 data-dojo-props="onClick:
79 function(){dijit.byId('firstId').set('value','Updated Widget');}">Update First from Widget</button>
80 </div>
81 </div>
82 </div>
83 </body>
84 </html>