1 <?xml version="1.0" encoding="UTF-8"?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> |
|
2 <html lang="en" xml:lang="en"> |
|
3 <head> |
|
4 <meta content="text/html; charset=utf-8" http-equiv="Content-Type" /> |
|
5 <meta name="copyright" content="(C) Copyright 2005" /> |
|
6 <meta name="DC.rights.owner" content="(C) Copyright 2005" /> |
|
7 <meta content="concept" name="DC.Type" /> |
|
8 <meta name="DC.Title" content="WRTKit SelectionControl Class" /> |
|
9 <meta scheme="URI" name="DC.Relation" content="WRTKit_API_Reference-GUID-00e47c27-0a1a-443f-ae85-cf3381635170.html" /> |
|
10 <meta content="XHTML" name="DC.Format" /> |
|
11 <meta content="GUID-35C4291F-DC3A-439C-890F-1D140864ACA0" name="DC.Identifier" /> |
|
12 <meta content="en" name="DC.Language" /> |
|
13 <link href="commonltr.css" type="text/css" rel="stylesheet" /> |
|
14 <title> |
|
15 WRTKit SelectionControl Class</title> |
|
16 </head> |
|
17 <body id="GUID-35C4291F-DC3A-439C-890F-1D140864ACA0"><a name="GUID-35C4291F-DC3A-439C-890F-1D140864ACA0"><!-- --></a> |
|
18 |
|
19 |
|
20 |
|
21 <h1 class="topictitle1"> |
|
22 WRTKit SelectionControl Class</h1> |
|
23 |
|
24 <div> |
|
25 |
|
26 <div class="section"><h2 class="sectiontitle"> |
|
27 Description</h2> |
|
28 |
|
29 |
|
30 <p> |
|
31 |
|
32 The SelectionControl class is an abstract base class for all controls that lets |
|
33 the user select one or more options from a set of options. |
|
34 </p> |
|
35 |
|
36 <p> |
|
37 |
|
38 The options in a selection control are simple option objects with two properties: |
|
39 value and text. An option is specified using JavaScript object notation (JSON) as |
|
40 <samp class="codeph"> |
|
41 { value: "value here", text: "Text for value goes here" }</samp>. The value |
|
42 property specifies the actual value of the option whereas the text property specifies |
|
43 how the option is shown to the user in the control. E.g. the value could be a boolean |
|
44 value while the text could be "Yes" or "No". The text value is an XHTML string. |
|
45 </p> |
|
46 |
|
47 <p> |
|
48 |
|
49 Don't instantiate SelectionControl directly but rather one of its subclasses. |
|
50 </p> |
|
51 |
|
52 </div> |
|
53 |
|
54 <div class="section"><h2 class="sectiontitle"> |
|
55 Inherits from</h2> |
|
56 |
|
57 |
|
58 <p> |
|
59 |
|
60 <a href="WRTKit_Control_Class-GUID-6ddb8154-3fed-40fc-b282-85e6d3ad494f.html"> |
|
61 Control</a> |
|
62 </p> |
|
63 |
|
64 </div> |
|
65 |
|
66 <div class="section"><h2 class="sectiontitle"> |
|
67 Events</h2> |
|
68 |
|
69 |
|
70 <br /><ul> |
|
71 |
|
72 <li> |
|
73 |
|
74 <p> |
|
75 SelectionChanged</p> |
|
76 |
|
77 |
|
78 |
|
79 <p> |
|
80 |
|
81 This event is fired when the user selects one or more values in the control. |
|
82 </p> |
|
83 |
|
84 |
|
85 </li> |
|
86 |
|
87 </ul> |
|
88 |
|
89 </div> |
|
90 |
|
91 </div> |
|
92 |
|
93 <div> |
|
94 <div class="familylinks"> |
|
95 <div class="parentlink"><strong>Parent topic:</strong> <a href="WRTKit_API_Reference-GUID-00e47c27-0a1a-443f-ae85-cf3381635170.html">WRTKit API Reference</a></div> |
|
96 </div> |
|
97 </div> |
|
98 <div class="nested1" id="GUID-8EEF9007-9B25-4140-A44E-FDC8E60E5515"><a name="GUID-8EEF9007-9B25-4140-A44E-FDC8E60E5515"><!-- --></a> |
|
99 |
|
100 <h2 class="topictitle2"> |
|
101 isMultipleSelection()</h2> |
|
102 |
|
103 <div> |
|
104 |
|
105 <div class="section"><h3 class="sectiontitle"> |
|
106 Syntax</h3> |
|
107 |
|
108 |
|
109 <pre> |
|
110 [Boolean] SelectionControl.isMultipleSelection(void)</pre> |
|
111 |
|
112 </div> |
|
113 |
|
114 <div class="section"><h3 class="sectiontitle"> |
|
115 Description</h3> |
|
116 |
|
117 |
|
118 <p> |
|
119 |
|
120 Returns a boolean value that indicates whether the selection control lets |
|
121 users select multiple options. |
|
122 </p> |
|
123 |
|
124 </div> |
|
125 |
|
126 <div class="section"><h3 class="sectiontitle"> |
|
127 Arguments</h3> |
|
128 |
|
129 |
|
130 <p> |
|
131 |
|
132 This method does not take any arguments. |
|
133 </p> |
|
134 |
|
135 </div> |
|
136 |
|
137 <div class="section"><h3 class="sectiontitle"> |
|
138 Return value</h3> |
|
139 |
|
140 |
|
141 <p> |
|
142 |
|
143 True if the control lets users select multiple options, false if only a single option |
|
144 can be selected at any given time. |
|
145 </p> |
|
146 |
|
147 </div> |
|
148 |
|
149 </div> |
|
150 |
|
151 </div> |
|
152 |
|
153 <div class="nested1" id="GUID-6CFB77B9-9930-49DC-982B-99F9CEBBEBCC"><a name="GUID-6CFB77B9-9930-49DC-982B-99F9CEBBEBCC"><!-- --></a> |
|
154 |
|
155 <h2 class="topictitle2"> |
|
156 isSelected()</h2> |
|
157 |
|
158 <div> |
|
159 |
|
160 <div class="section"><h3 class="sectiontitle"> |
|
161 Syntax</h3> |
|
162 |
|
163 |
|
164 <pre> |
|
165 [Boolean] SelectionControl.isSelected(Option option)</pre> |
|
166 |
|
167 </div> |
|
168 |
|
169 <div class="section"><h3 class="sectiontitle"> |
|
170 Description</h3> |
|
171 |
|
172 |
|
173 <p> |
|
174 |
|
175 Returns a boolean value that indicates whether the the specified option |
|
176 is currently selected. Options are objects with two properties: value and text. |
|
177 </p> |
|
178 |
|
179 </div> |
|
180 |
|
181 <div class="section"><h3 class="sectiontitle"> |
|
182 Arguments</h3> |
|
183 |
|
184 |
|
185 <br /><ul> |
|
186 |
|
187 <li> |
|
188 |
|
189 <p> |
|
190 option</p> |
|
191 |
|
192 |
|
193 |
|
194 <p> |
|
195 |
|
196 The option to check the selected state for. |
|
197 </p> |
|
198 |
|
199 |
|
200 </li> |
|
201 |
|
202 </ul> |
|
203 |
|
204 </div> |
|
205 |
|
206 <div class="section"><h3 class="sectiontitle"> |
|
207 Return value</h3> |
|
208 |
|
209 |
|
210 <p> |
|
211 |
|
212 True if the specified option is selected, false if not. |
|
213 </p> |
|
214 |
|
215 </div> |
|
216 |
|
217 </div> |
|
218 |
|
219 </div> |
|
220 |
|
221 <div class="nested1" id="GUID-DE791188-37C3-4433-BB16-9362EFFECFEE"><a name="GUID-DE791188-37C3-4433-BB16-9362EFFECFEE"><!-- --></a> |
|
222 |
|
223 <h2 class="topictitle2"> |
|
224 getSelected()</h2> |
|
225 |
|
226 <div> |
|
227 |
|
228 <div class="section"><h3 class="sectiontitle"> |
|
229 Syntax</h3> |
|
230 |
|
231 |
|
232 <pre> |
|
233 [Option|Array] SelectionControl.getSelected(void)</pre> |
|
234 |
|
235 </div> |
|
236 |
|
237 <div class="section"><h3 class="sectiontitle"> |
|
238 Description</h3> |
|
239 |
|
240 |
|
241 <p> |
|
242 |
|
243 Retrieves the currently selected option or options. If the control is a multiple |
|
244 selection control then an array of selected options is returned (an empty array if |
|
245 no options are selected). If the control is a single selection control then the |
|
246 single selection option is returned, or null if no options are selected. |
|
247 Options are objects with two properties: value and text. |
|
248 </p> |
|
249 |
|
250 </div> |
|
251 |
|
252 <div class="section"><h3 class="sectiontitle"> |
|
253 Arguments</h3> |
|
254 |
|
255 |
|
256 <p> |
|
257 |
|
258 This method does not take any arguments. |
|
259 </p> |
|
260 |
|
261 </div> |
|
262 |
|
263 <div class="section"><h3 class="sectiontitle"> |
|
264 Return value</h3> |
|
265 |
|
266 |
|
267 <p> |
|
268 |
|
269 An array containing the currently selected options for multiple selection controls. |
|
270 For single selection controls the return value is the selected option. If no options |
|
271 are selected then an empty array is returned for multiple selection controls and null |
|
272 is returned for single selection controls. |
|
273 </p> |
|
274 |
|
275 </div> |
|
276 |
|
277 </div> |
|
278 |
|
279 </div> |
|
280 |
|
281 <div class="nested1" id="GUID-348A4EC8-8962-4CB3-BD22-39D095280995"><a name="GUID-348A4EC8-8962-4CB3-BD22-39D095280995"><!-- --></a> |
|
282 |
|
283 <h2 class="topictitle2"> |
|
284 setSelected()</h2> |
|
285 |
|
286 <div> |
|
287 |
|
288 <div class="section"><h3 class="sectiontitle"> |
|
289 Syntax</h3> |
|
290 |
|
291 |
|
292 <pre> |
|
293 [void] SelectionControl.setSelected(Option|Array selected)</pre> |
|
294 |
|
295 </div> |
|
296 |
|
297 <div class="section"><h3 class="sectiontitle"> |
|
298 Description</h3> |
|
299 |
|
300 |
|
301 <p> |
|
302 |
|
303 Sets the currently selected options for a selection control. The selected options |
|
304 should be a subset of the options contain within the control. For a multiple selection |
|
305 control an array of options should be specified. For a single selection control the |
|
306 single option that should be selected should be specified without being contained in |
|
307 an array. To select zero options pass an empty array for multiple selection controls |
|
308 and null for single selection controls. Options are objects with two properties: |
|
309 value and text. |
|
310 </p> |
|
311 |
|
312 </div> |
|
313 |
|
314 <div class="section"><h3 class="sectiontitle"> |
|
315 Arguments</h3> |
|
316 |
|
317 |
|
318 <br /><ul> |
|
319 |
|
320 <li> |
|
321 |
|
322 <p> |
|
323 selected</p> |
|
324 |
|
325 |
|
326 |
|
327 <p> |
|
328 |
|
329 The options to select. For multiple selection controls this argument |
|
330 should be an array of the options to select or an empty array to select |
|
331 zero elements. For single selection controls it should be a single option |
|
332 object or null for no selected options. |
|
333 </p> |
|
334 |
|
335 |
|
336 </li> |
|
337 |
|
338 </ul> |
|
339 |
|
340 </div> |
|
341 |
|
342 <div class="section"><h3 class="sectiontitle"> |
|
343 Return value</h3> |
|
344 |
|
345 |
|
346 <p> |
|
347 |
|
348 This method does not return a value. |
|
349 </p> |
|
350 |
|
351 </div> |
|
352 |
|
353 </div> |
|
354 |
|
355 </div> |
|
356 |
|
357 <div class="nested1" id="GUID-97BCB1F7-4DEC-4621-9B22-87123719CF7B"><a name="GUID-97BCB1F7-4DEC-4621-9B22-87123719CF7B"><!-- --></a> |
|
358 |
|
359 <h2 class="topictitle2"> |
|
360 getOptions()</h2> |
|
361 |
|
362 <div> |
|
363 |
|
364 <div class="section"><h3 class="sectiontitle"> |
|
365 Syntax</h3> |
|
366 |
|
367 |
|
368 <pre> |
|
369 [Array] SelectionControl.getOptions(void)</pre> |
|
370 |
|
371 </div> |
|
372 |
|
373 <div class="section"><h3 class="sectiontitle"> |
|
374 Description</h3> |
|
375 |
|
376 |
|
377 <p> |
|
378 |
|
379 Retrieves the options available to the user in the control. The options are |
|
380 returned as an array of option objects. Options are objects with two properties: |
|
381 value and text. |
|
382 </p> |
|
383 |
|
384 </div> |
|
385 |
|
386 <div class="section"><h3 class="sectiontitle"> |
|
387 Arguments</h3> |
|
388 |
|
389 |
|
390 <p> |
|
391 |
|
392 This method does not take any arguments. |
|
393 </p> |
|
394 |
|
395 </div> |
|
396 |
|
397 <div class="section"><h3 class="sectiontitle"> |
|
398 Return value</h3> |
|
399 |
|
400 |
|
401 <p> |
|
402 |
|
403 An array containing the options in the control. |
|
404 </p> |
|
405 |
|
406 </div> |
|
407 |
|
408 </div> |
|
409 |
|
410 </div> |
|
411 |
|
412 <div class="nested1" id="GUID-167CC713-AF75-4CC7-841E-974D4CB77C1D"><a name="GUID-167CC713-AF75-4CC7-841E-974D4CB77C1D"><!-- --></a> |
|
413 |
|
414 <h2 class="topictitle2"> |
|
415 setOptions()</h2> |
|
416 |
|
417 <div> |
|
418 |
|
419 <div class="section"><h3 class="sectiontitle"> |
|
420 Syntax</h3> |
|
421 |
|
422 |
|
423 <pre> |
|
424 [void] SelectionControl.setOptions(Array options)</pre> |
|
425 |
|
426 </div> |
|
427 |
|
428 <div class="section"><h3 class="sectiontitle"> |
|
429 Description</h3> |
|
430 |
|
431 |
|
432 <p> |
|
433 |
|
434 Sets the options that this control should give the user. Calling this method |
|
435 replaces the current options with the specified new ones. If one or more selected |
|
436 options are no longer part of the available options after calling this method |
|
437 then they will automatically be removed from the selected set. The options |
|
438 are given as an array of option objects. Options are objects with two properties: |
|
439 value and text. The text value is an XHTML string. |
|
440 </p> |
|
441 |
|
442 </div> |
|
443 |
|
444 <div class="section"><h3 class="sectiontitle"> |
|
445 Arguments</h3> |
|
446 |
|
447 |
|
448 <br /><ul> |
|
449 |
|
450 <li> |
|
451 |
|
452 <p> |
|
453 options</p> |
|
454 |
|
455 |
|
456 |
|
457 <p> |
|
458 |
|
459 An array of options to give the user. These options replace the |
|
460 current options in the control. |
|
461 </p> |
|
462 |
|
463 |
|
464 </li> |
|
465 |
|
466 </ul> |
|
467 |
|
468 </div> |
|
469 |
|
470 <div class="section"><h3 class="sectiontitle"> |
|
471 Return value</h3> |
|
472 |
|
473 |
|
474 <p> |
|
475 |
|
476 This method does not return a value. |
|
477 </p> |
|
478 |
|
479 </div> |
|
480 |
|
481 </div> |
|
482 |
|
483 </div> |
|
484 |
|
485 <div class="nested1" id="GUID-815B72AA-CB42-4A8C-B656-6C144BC356F6"><a name="GUID-815B72AA-CB42-4A8C-B656-6C144BC356F6"><!-- --></a> |
|
486 |
|
487 <h2 class="topictitle2"> |
|
488 getOptionForValue()</h2> |
|
489 |
|
490 <div> |
|
491 |
|
492 <div class="section"><h3 class="sectiontitle"> |
|
493 Syntax</h3> |
|
494 |
|
495 |
|
496 <pre> |
|
497 [Array] SelectionControl.getOptionForValue(Object value)</pre> |
|
498 |
|
499 </div> |
|
500 |
|
501 <div class="section"><h3 class="sectiontitle"> |
|
502 Description</h3> |
|
503 |
|
504 |
|
505 <p> |
|
506 |
|
507 Retrieves the option in the selection control that has a value that matches |
|
508 the specified one. If multiple options have the same value then the first matching |
|
509 one is returned. If there is no match then null is returned. |
|
510 </p> |
|
511 |
|
512 <p> |
|
513 |
|
514 This method is a useful helper method for situations where a specific value in the |
|
515 options should be programmatically selected. |
|
516 </p> |
|
517 |
|
518 </div> |
|
519 |
|
520 <div class="section"><h3 class="sectiontitle"> |
|
521 Arguments</h3> |
|
522 |
|
523 |
|
524 <br /><ul> |
|
525 |
|
526 <li> |
|
527 |
|
528 <p> |
|
529 value</p> |
|
530 |
|
531 |
|
532 |
|
533 <p> |
|
534 |
|
535 The value to search for among the options in the selection control. |
|
536 The value can be of any JavaScript type. |
|
537 </p> |
|
538 |
|
539 |
|
540 </li> |
|
541 |
|
542 </ul> |
|
543 |
|
544 </div> |
|
545 |
|
546 <div class="section"><h3 class="sectiontitle"> |
|
547 Return value</h3> |
|
548 |
|
549 |
|
550 <p> |
|
551 |
|
552 The first option in this selection control that has a value that matches the |
|
553 specified one, or null if no matching option is found. |
|
554 </p> |
|
555 |
|
556 </div> |
|
557 |
|
558 </div> |
|
559 |
|
560 </div> |
|
561 |
|
562 |
|
563 </body> |
|
564 </html> |
|