-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathdatatable-issue-01.xhtml
304 lines (298 loc) · 10.4 KB
/
datatable-issue-01.xhtml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
<?xml version="1.0" encoding="UTF-8"?>
<html xmlns="http://www.w3.org/1999/xhtml"
xmlns:xi="http://www.w3.org/2001/XInclude"
xmlns:ev="http://www.w3.org/2001/xml-events"
xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns:xxf="http://orbeon.org/oxf/xml/xforms"
xmlns:fr="http://orbeon.org/oxf/xml/form-runner"
xmlns:f="http://orbeon.org/oxf/xml/formatting"
xmlns:xf="http://www.w3.org/2002/xforms">
<head>
<meta name="ROBOTS" CONTENT="NONE,NOARCHIVE,NOFOLLOW" />
<meta name="apple-mobile-web-app-capable" content="yes" />
<title>Test-Datatable-Issue</title>
<xf:model id="coreModel">
<xf:instance xmlns:xxf="http://orbeon.org/oxf/xml/xforms" xmlns:xf="http://www.w3.org/2002/xforms" id="constants" xxf:readonly="true">
<constants xmlns="">
<diaryStatus>
<status>
<name>Booked</name>
<value>Booked</value>
<color>GREY</color>
</status>
<status>
<name>Arrived</name>
<value>Arrived</value>
<color>RED</color>
</status>
<status>
<name>Did Not Show</name>
<value>DidNotShow</value>
<color>YELLOW</color>
</status>
<status>
<name>Blocked</name>
<value>Blocked</value>
<color>GREY</color>
</status>
<status>
<name>Cancelled</name>
<value>Cancelled</value>
<color>WHITE</color>
</status>
</diaryStatus>
</constants>
</xf:instance>
<xf:instance xmlns:xf="http://www.w3.org/2002/xforms" id="appointmentList">
<examinations xmlns="">
<descriptions>
<name>Introduction</name>
</descriptions>
<descriptions>
<name>Follow-up</name>
</descriptions>
<descriptions>
<name>Revision</name>
</descriptions>
</examinations>
</xf:instance>
</xf:model>
<xf:model id="diaryModel">
<xf:instance id="booking">
<booking xmlns="">
<slotKey/>
<location1/>
<location2/>
<location3/>
<gSummary/>
<gdStart/>
<gtStart/>
<gtEnd/>
<dstart/>
<tstart/>
<dend/>
<tend/>
<summary/>
<attendee/>
<attendeeName/>
<contact/>
<description/>
<status/>
<ftype/>
</booking>
</xf:instance>
<xf:bind nodeset="instance('booking')">
<xf:bind nodeset="tstart" required="true()"/>
<xf:bind nodeset="tend" required="true()"/>
<xf:bind nodeset="gdStart" type="xs:date" readonly="false()" calculate="if (xs:string(.) = '') then xs:date(substring(xs:string(current-date()),1,10)) else ." />
<xf:bind nodeset="dstart" required="true()" type="xs:date" readonly="false()" calculate="if (xs:string(.) = '') then xs:date(substring(xs:string(current-date()),1,10)) else ." />
<xf:bind nodeset="dend" required="true()" type="xs:date" readonly="false()" calculate="if (xs:string(.) = '') then xs:date(substring(xs:string(current-date()),1,10)) else ." />
</xf:bind>
<xf:instance id="diaries">
<Diaries xmlns="">
<IND>
<diary><name>Do not Book Individual</name><value>IGNORE</value></diary>
<diary><name>Dave Jones</name><value>1</value></diary>
<diary><name>Robert Smith</name><value>2</value></diary>
</IND>
<FAC>
<diary><name>Do not Book Room</name><value>IGNORE</value></diary>
<diary><name>Lecture Theatre 1</name><value>L1</value></diary>
<diary><name>Lecture Theatre 2</name><value>L2</value></diary>
</FAC>
</Diaries>
</xf:instance>
<xf:instance id="resultDModel">
<Results xmlns="">
<person>
<contactKey/>
<customerno/>
<familyName/>
<givenName/>
<DOB/>
<contactno/>
<attendeeName/>
</person>
<person>
<contactKey>C1</contactKey>
<customerno>123456</customerno>
<familyName>Littlewood</familyName>
<givenName>John</givenName>
<DOB>12-01-1967</DOB>
<contactno>03 2928 2929</contactno>
<attendeeName>John Littlewood</attendeeName>
</person>
<person>
<contactKey>C2</contactKey>
<customerno>123256</customerno>
<familyName>Bentworth</familyName>
<givenName>Timothy</givenName>
<DOB>07-12-1953</DOB>
<contactno>03 5363 8763</contactno>
<attendeeName>Timothy Bentworth</attendeeName>
</person>
</Results>
</xf:instance>
</xf:model>
</head>
<body>
<xxf:dialog id="dialogAppointment" draggable="true" model="diaryModel" appearance="full" level="modal"
xmlns="http://www.w3.org/1999/xhtml"
xmlns:xxf="http://orbeon.org/oxf/xml/xforms"
xmlns:ev="http://www.w3.org/2001/xml-events"
xmlns:xf="http://www.w3.org/2002/xforms"
xmlns:fr="http://orbeon.org/oxf/xml/form-runner"
xmlns:f="http://orbeon.org/oxf/xml/formatting">
<f:label>Booking</f:label>
<xf:action ev:event="xxforms-dialog-open">
<xf:toggle case="mainbooking"/>
</xf:action>
<div style="width: 450px; height: 500px;" class="screenBlock">
<br />
<xf:switch>
<xf:case id="mainbooking">
<div style="font-weight: bold; line-height: 28px; height: 440px; width: 125px; float: left;">
Director<br /> Assistant<br /> Room<br /> Start Session<br /> End Session<br /> Appointment<br />
Attendee<br /> Contact<br /> Description<br /><br /><br /> Status<br />
</div>
<xf:group ref="instance('booking')">
<div style="line-height: 28px; height: 440px; width: 300px; float: left; verticalAlign: middle;">
<xf:select1 ref="location1">
<xf:label/>
<xf:itemset nodeset="instance('diaries')/IND/diary">
<xf:label ref="name"/>
<xf:value ref="value"/>
</xf:itemset>
</xf:select1>
<br />
<xf:select1 ref="location2">
<xf:label/>
<xf:itemset nodeset="instance('diaries')/IND/diary">
<xf:label ref="name"/>
<xf:value ref="value"/>
</xf:itemset>
</xf:select1>
<br />
<xf:select1 ref="location3">
<xf:label/>
<xf:itemset nodeset="instance('diaries')/FAC/diary">
<xf:label ref="name"/>
<xf:value ref="value"/>
</xf:itemset>
</xf:select1>
<br />
<xf:input ref="dstart" xxf:size="10">
<xf:label>
<xf:output ref="dstart" xxf:format="format-date(xs:date(.), '[FNn]')" />
</xf:label>
<xf:action ev:event="DOMFocusOut">
<xf:setvalue ref="instance('booking')/dend" value="instance('booking')/dstart"/>
</xf:action>
</xf:input>
<xf:input ref="tstart" xxf:size="5" >
<xf:label> at </xf:label>
<xf:action ev:event="DOMFocusOut">
<xf:setvalue ref="instance('booking')/dend" value="instance('booking')/dstart"/>
</xf:action>
</xf:input>
<br />
<xf:input ref="dend" xxf:size="10">
<xf:label>
<xf:output ref="dend" xxf:format="format-date(xs:date(.), '[FNn]')" />
</xf:label>
</xf:input>
<xf:input ref="tend" xxf:size="5" >
<xf:label> at </xf:label>
</xf:input>
<br />
<xf:select1 ref="summary">
<xf:label></xf:label>
<xf:itemset model="coreModel" nodeset="instance('appointmentList')/descriptions">
<xf:label ref="name"/>
<xf:value ref="name"/>
</xf:itemset>
</xf:select1>
<br />
<xf:input ref="attendeeName" xxf:size="40em;">
<xf:label/>
</xf:input>
<xf:trigger appearance="compact">
<xf:label>Open Datatable</xf:label>
<xf:action ev:event="DOMActivate">
<xf:toggle case="searchIndividual"/>
</xf:action>
</xf:trigger>
<br />
<xf:input ref="contact">
<xf:label/>
</xf:input>
<br />
<xf:textarea ref="description" xxf:cols="50" xxf:rows="5" style="resize: none;" />
<br />
<xf:select1 ref="status">
<xf:label/>
<xf:itemset model="coreModel" nodeset="instance('constants')/diaryStatus/status">
<xf:label ref="name"/>
<xf:value ref="value"/>
</xf:itemset>
</xf:select1>
<br />
<br />
<div style="width: 60px;" class="PrimaryButton">
<xf:trigger appearance="minimal">
<xf:label>Save</xf:label>
<xf:action ev:event="DOMActivate">
<xxf:hide dialog="dialogAppointment"/>
</xf:action>
</xf:trigger>
</div>
<br />
</div>
</xf:group>
<div style="clear: both;"></div>
</xf:case>
<xf:case id="searchIndividual">
<fr:datatable id="datatable1" scrollable="vertical" height="250px" width="420px">
<thead>
<tr>
<th fr:resizeable="true"></th>
<th fr:resizeable="true">#</th>
<th fr:resizeable="true">Last Name</th>
<th fr:resizeable="true">First Name</th>
<th fr:resizeable="true">DOB</th>
<th fr:resizeable="true">Contact</th>
</tr>
</thead>
<tbody>
<tr style="cursor: pointer;" repeat-nodeset="xxf:instance('resultDModel')/person" id="listBooking">
<td style="width: 15px;"><xf:output value="if (position()>1) then position()-1 else ''"/></td>
<td><xf:output ref="customerno" /></td>
<td><xf:output ref="familyName" /></td>
<td><xf:output ref="givenName" /></td>
<td><xf:output ref="DOB" /></td>
<td><xf:output ref="contactno" /></td>
<xf:action ev:event="xxforms-index-changed">
<xf:setvalue ref="xxf:instance('booking')/attendee" value="xxf:instance('resultDModel')/person[index('listBooking')]/contactKey" />
<xf:setvalue ref="xxf:instance('booking')/givenName" value="xxf:instance('resultDModel')/person[index('listBooking')]/givenName" />
<xf:setvalue ref="xxf:instance('booking')/familyName" value="xxf:instance('resultDModel')/person[index('listBooking')]/familyName" />
<xf:setvalue ref="xxf:instance('booking')/dob" value="xxf:instance('resultDModel')/person[index('listBooking')]/DOB" />
<xf:setvalue ref="xxf:instance('booking')/attendeeName" value="xxf:instance('resultDModel')/person[index('listBooking')]/attendeeName" />
<xf:setvalue ref="xxf:instance('booking')/contact" value="xxf:instance('resultDModel')/person[index('listBooking')]/contactno" />
<xf:toggle case="mainbooking"/>
</xf:action>
</tr>
</tbody>
</fr:datatable>
</xf:case>
</xf:switch>
<br />
</div>
</xxf:dialog>
<xf:trigger appearance="full">
<xf:label>Enable Dialog</xf:label>
<xf:action ev:event="DOMActivate">
<xxf:show dialog="dialogAppointment"/>
</xf:action>
</xf:trigger>
</body>
</html>