Debian Codegraph @

dojox/mvc/tests/1.7/test_mvc_shipto-billto-simple-declarative.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 -- Declarative 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 </script>
42 </head>
43 <body class="claro">
44 <!--
45 The following dojox.mvc.StatefulModel creates a data model instance
46 where each leaf within the data model is decorated with dojo.Stateful
47 properties that widgets can bind to and watch for their changes.
48 -->
49 <div data-dojo-type="dojox.mvc.StatefulModel" data-dojo-props="data: order" data-dojo-id="model"></div>
50 <div id="wrapper">
51 <div id="header">
52 <div id="navigation">
53 </div>
54 <div id="headerInsert">
55 <h1>Order Shipping Details</h1>
56 <h2>Declarative Data Binding Example - Group Container.</h2>
57 </div>
58 </div>
59 <div id="main">
60 <div id="leftNav">
61 </div>
62 <div id="mainContent">
63 <!--
64 The group container denotes some logical grouping of widgets and also serves
65 to establish a parent data binding context for its children.
66 The ref attribute for the outermost container obtains the binding from the
67 "page scope" itself.
68 -->
69 <div class="row" data-dojo-type="dojox.mvc.Group" data-dojo-props="ref: 'expr:model'">
70 <div class="row">
71 <label class="cell" for="serialInput">Order #:</label>
72 <input class="cell" id="serialInput" data-dojo-type="dijit.form.TextBox"
73 data-dojo-props="ref: 'Serial'"/>
74 </div>
75 <div class="row">
76 <label class="cell" for="lastnameInput">Last:</label>
77 <input class="cell" id="lastnameInput" data-dojo-type="dijit.form.TextBox"
78 data-dojo-props="ref: 'Last'"/>
79 </div>
80 <div class="row">
81 <label class="cell" for="emailInput">Email:</label>
82 <input class="cell" id="emailInput" data-dojo-type="dijit.form.TextBox"
83 data-dojo-props="ref: 'Email'"/>
84 </div>
85 </div>
86 <br/>
87 Choose:
88 <button id="shipto" type="button" data-dojo-type="dijit.form.Button" data-dojo-props="onClick: function(){setRef('addrGroup', 'model.ShipTo');}">Ship To</button>
89 <button id="billto" type="button" data-dojo-type="dijit.form.Button" data-dojo-props="onClick: function(){setRef('addrGroup', 'model.BillTo');}">Bill To</button>
90 <br/>
91 <!--
92 For convenience, the widget hierarchy matches the data hierarchy
93 (see JSON literal above).
94 In this implementation, the child ref attributes are simple property names
95 of the parent binding context.
96 The ref attribute may support more advanced constructs, such as queries
97 over the parent widget's or other application specified binding context.
98 -->
99 <div class="row" id="addrGroup" data-dojo-type="dojox.mvc.Group" data-dojo-props="ref: 'model.ShipTo'">
100 <div class="row">
101 <label class="cell" for="streetInput">Street:</label>
102 <input class="cell" id="streetInput" data-dojo-type="dijit.form.TextBox"
103 data-dojo-props="ref: 'Street'"/>
104 </div>
105 <div class="row">
106 <label class="cell" for="cityInput">City:</label>
107 <input class="cell" id="cityInput" data-dojo-type="dijit.form.TextBox"
108 data-dojo-props="ref: 'City'"/>
109 </div>
110 <div class="row">
111 <label class="cell" for="stateInput">State:</label>
112 <input class="cell" id="stateInput" data-dojo-type="dijit.form.TextBox"
113 data-dojo-props="ref: 'State'"/>
114 </div>
115 <div class="row">
116 <label class="cell" for="zipInput">Zipcode:</label>
117 <input class="cell" id="zipInput" data-dojo-type="dijit.form.TextBox"
118 data-dojo-props="ref: 'Zip'"/>
119 </div>
120 </div>
121 <br/>
122 Model:
123 <button id="reset" type="button" data-dojo-type="dijit.form.Button" data-dojo-props="onClick: function(){model.reset();}">Reset</button>
124 </div></div></div>
125 <script type="text/javascript">
126 function setRef(id, addrRef) {
127 var widget = dijit.byId(id);
128 widget.set("ref", addrRef);
129 }
130 </script>
131 </body>
132 </html>