Debian Codegraph @

dojox/mvc/tests/1.7/test_mvc_shipto-billto-simple-oldparser.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
7 <script src="../../../../dojo/dojo.js"
8 type="text/javascript"
9 djConfig="parseOnLoad: true, isDebug: true">
10 </script>
11 <style type="text/css">
12 @import "css/app-format.css";
13 @import "../../../../dijit/themes/claro/claro.css";
14 </style>
15 <script type="text/javascript" >
16 dojo.require("dojox.mvc");
17 dojo.require("dojox.mvc.Group");
18 dojo.require("dijit.form.TextBox");
19 dojo.require("dijit.form.Button");
20 dojo.require("dojo.parser");
21
22 // Initial data
23 var order = {
24 "Serial" : "360324",
25 "First" : "John",
26 "Last" : "Doe",
27 "Email" : "[email protected]",
28 "ShipTo" : {
29 "Street" : "123 Valley Rd",
30 "City" : "Katonah",
31 "State" : "NY",
32 "Zip" : "10536"
33 },
34 "BillTo" : {
35 "Street" : "17 Skyline Dr",
36 "City" : "Hawthorne",
37 "State" : "NY",
38 "Zip" : "10532"
39 }
40 };
41
42 // The dojox.mvc.StatefulModel class creates a data model instance
43 // where each leaf within the data model is decorated with dojo.Stateful
44 // properties that widgets can bind to and watch for their changes.
45 var model = dojox.mvc.newStatefulModel({ data : order });
46 </script>
47 </head>
48 <body class="claro">
49 <div id="wrapper">
50 <div id="header">
51 <div id="navigation">
52 </div>
53 <div id="headerInsert">
54 <h1>Order Shipping Details</h1>
55 <h2>Data Binding Example - Group Container.</h2>
56 </div>
57 </div>
58 <div id="main">
59 <div id="leftNav">
60 </div>
61 <div id="mainContent">
62 <!--
63 The group container denotes some logical grouping of widgets and also serves
64 to establish a parent data binding context for its children.
65 The ref value for the outermost container obtains the binding from the
66 "page scope" itself.
67 -->
68 <div class="row" dojoType="dojox.mvc.Group" ref="model">
69 <div class="row">
70 <label class="cell" for="serialInput">Order #:</label>
71 <input class="cell" id="serialInput" dojoType="dijit.form.TextBox"
72 ref="'Serial'"></input>
73 </div>
74 <div class="row">
75 <label class="cell" for="lastnameInput">Last:</label>
76 <input class="cell" id="lastnameInput" dojoType="dijit.form.TextBox"
77 ref="'Last'"></input>
78 </div>
79 <div class="row">
80 <label class="cell" for="emailInput">Email:</label>
81 <input class="cell" id="emailInput" dojoType="dijit.form.TextBox"
82 ref="'Email'"></input>
83 </div>
84 </div>
85 <br/>
86 Choose:
87 <button id="shipto" type="button" dojoType="dijit.form.Button" onclick="setRef('addrGroup', model.ShipTo)">Ship To</button>
88 <button id="billto" type="button" dojoType="dijit.form.Button" onclick="setRef('addrGroup', model.BillTo)">Bill To</button>
89 <br/>
90 <!--
91 For convenience, the widget hierarchy matches the data hierarchy
92 (see JavaScript object literal above).
93 In this implementation, the child ref values are simple property names
94 of the parent binding context.
95 The ref value may support more advanced constructs, such as queries
96 over the parent widget's or other application specified binding context.
97 -->
98 <div class="row" id="addrGroup" dojoType="dojox.mvc.Group" ref="model.ShipTo">
99 <div class="row">
100 <label class="cell" for="streetInput">Street:</label>
101 <input class="cell" id="streetInput" dojoType="dijit.form.TextBox"
102 ref="'Street'"></input>
103 </div>
104 <div class="row">
105 <label class="cell" for="cityInput">City:</label>
106 <input class="cell" id="cityInput" dojoType="dijit.form.TextBox"
107 ref="'City'"></input>
108 </div>
109 <div class="row">
110 <label class="cell" for="stateInput">State:</label>
111 <input class="cell" id="stateInput" dojoType="dijit.form.TextBox"
112 ref="'State'"></input>
113 </div>
114 <div class="row">
115 <label class="cell" for="zipInput">Zipcode:</label>
116 <input class="cell" id="zipInput" dojoType="dijit.form.TextBox"
117 ref="'Zip'"></input>
118 </div>
119 </div>
120 <br/>
121 Model:
122 <button id="reset" type="button" dojoType="dijit.form.Button" onclick="model.reset()">Reset</button>
123 </div></div></div>
124 <script type="text/javascript">
125 function setRef(id, addrRef) {
126 var widget = dijit.byId(id);
127 widget.set("ref", addrRef);
128 }
129 </script>
130 </body>
131 </html>