Wiki source code of WORadioButtonList
Version 18.1 by Klaus Berkling on 2012/03/03 17:41
Show last authors
author | version | line-number | content |
---|---|---|---|
1 | == Introduction == | ||
2 | |||
3 | WORadioButtonList displays a list of radio buttons. The user can make a selection that is then returned selection object. | ||
4 | |||
5 | == Usage == | ||
6 | |||
7 | In the WOD File: | ||
8 | |||
9 | {{code}} | ||
10 | |||
11 | WORadioButtonList { | ||
12 | list = ObjectsList; | ||
13 | item = ObjectItemInList; | ||
14 | displayString = ObjectItemInList.displayString; | ||
15 | [value = valueOfInputTag;] | ||
16 | [index = ObjectListIndex;] | ||
17 | [prefix = prefixHTMLString;] | ||
18 | [suffix = suffixHTMLString;] | ||
19 | [selection = selectedObjectInList;] | ||
20 | [name = aName;] | ||
21 | [disabled = disabledList;] | ||
22 | [escapeHTML = renderDisplayStringAsHTML;] | ||
23 | } | ||
24 | |||
25 | {{/code}} | ||
26 | |||
27 | == Bindings == | ||
28 | |||
29 | Note: Use a string in displayString that is part of the item object, if there is no displayString then the value is used as the label for the radio button. | ||
30 | |||
31 | | list | An array of objects | ||
32 | | item | An element from the list array | ||
33 | | displayString | A string used as the label for the radio button. If there is no displayString the value is used | ||
34 | | value | The value in INPUT TYPE="radio" VAUE="aValue" | ||
35 | | index | Index of the current integration of the list array | ||
36 | | prefix | HTML prefix to the displayString | ||
37 | | suffix | HTML suffix to the displayString | ||
38 | | selection | The selected object from the list array | ||
39 | | name | The name in INPUT tag | ||
40 | | disabled | If true then the radio button is disabled | ||
41 | | escapeHTML | Rendered the displayString as HTML | ||
42 | |||
43 | == Example == | ||
44 | |||
45 | Java: | ||
46 | |||
47 | {{code}} | ||
48 | |||
49 | NSArray colorList = new NSArray<String>("#ffffff","#2F64DA","#37B11B","#E71E27","#F38B1E","#BE33BB","#6138AF"); | ||
50 | String selectedColor = "#ffffff"; | ||
51 | |||
52 | {{/code}} | ||
53 | |||
54 | HTML: | ||
55 | |||
56 | {{code}} | ||
57 | |||
58 | <tr> | ||
59 | <th>Color</th> | ||
60 | <td nowrap class="radiobuttons-horizontal"> | ||
61 | <webobject name = "ColorList"/> | ||
62 | </td> | ||
63 | </tr> | ||
64 | |||
65 | {{/code}} | ||
66 | |||
67 | WOD: | ||
68 | |||
69 | {{code}} | ||
70 | |||
71 | ColorList : WORadioButtonList { | ||
72 | list = colorList; | ||
73 | item = colorItemInList; | ||
74 | selection = selectedColor; | ||
75 | prefix = " <tt style='border: 1px solid #202020; background-color: "; | ||
76 | suffix = ";'> </tt> "; | ||
77 | } | ||
78 | |||
79 | |||
80 | {{/code}} |