Wiki source code of WORadioButtonList

Last modified by Klaus Berkling on 2012/03/03 17:59

Show last authors
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 |(((
30 list
31 )))|(((
32 An array of objects
33 )))
34 |(((
35 item
36 )))|(((
37 An element from the list array
38 )))
39 |(((
40 displayString
41 )))|(((
42 A string used as the label for the radio button. If there is no displayString the value is used
43 )))
44 |(((
45 value
46 )))|(((
47 The value in INPUT TYPE="radio" VAUE="aValue"
48 )))
49 |(((
50 index
51 )))|(((
52 Index of the current integration of the list array
53 )))
54 |(((
55 prefix
56 )))|(((
57 HTML prefix to the displayString
58 )))
59 |(((
60 suffix
61 )))|(((
62 HTML suffix to the displayString
63 )))
64 |(((
65 selection
66 )))|(((
67 The selected object from the list array
68 )))
69 |(((
70 name
71 )))|(((
72 The name in INPUT tag
73 )))
74 |(((
75 disabled
76 )))|(((
77 If true then the radio button is disabled
78 )))
79 |(((
80 escapeHTML
81 )))|(((
82 Rendered the displayString as HTML
83 )))
84
85 == Example ==
86
87 A not so quite simple example.
88
89 Java:
90
91 {{code}}
92
93 public NSArray<String> colorList = new NSArray<String>("#ffffff","#2F64DA","#37B11B","#E71E27","#F38B1E","#BE33BB","#6138AF");
94 public String selectedColor = "#ffffff";
95 public String colorItemInList;
96
97 {{/code}}
98
99 HTML:
100
101 {{code}}
102
103 <tr>
104 <th>Color</th>
105 <td nowrap class="radiobuttons-horizontal">
106 <webobject name = "ColorList"/>
107 </td>
108 </tr>
109
110 {{/code}}
111
112 WOD:
113
114 {{code}}
115
116 ColorList : WORadioButtonList {
117 list = colorList;
118 item = colorItemInList;
119 selection = selectedColor;
120 prefix = "&nbsp;<tt style='border: 1px solid #202020; background-color: ";
121 suffix = ";'>&nbsp;&nbsp;&nbsp;</tt>&nbsp;&nbsp;&nbsp;";
122 }
123
124 {{/code}}