Wiki source code of WORadioButtonList

Version 19.1 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 | list | An array of objects
30 | item | An element from the list array
31 | displayString | A string used as the label for the radio button. If there is no displayString the value is used
32 | value | The value in INPUT TYPE="radio" VAUE="aValue"
33 | index | Index of the current integration of the list array
34 | prefix | HTML prefix to the displayString
35 | suffix | HTML suffix to the displayString
36 | selection | The selected object from the list array
37 | name | The name in INPUT tag
38 | disabled | If true then the radio button is disabled
39 | escapeHTML | Rendered the displayString as HTML
40
41 == Example ==
42
43 A not so quite simple example.
44
45 Java:
46
47 {{code}}
48
49 public NSArray<String> colorList = new NSArray<String>("#ffffff","#2F64DA","#37B11B","#E71E27","#F38B1E","#BE33BB","#6138AF");
50 public String selectedColor = "#ffffff";
51 public String colorItemInList;
52
53 {{/code}}
54
55 HTML:
56
57 {{code}}
58
59 <tr>
60 <th>Color</th>
61 <td nowrap class="radiobuttons-horizontal">
62 <webobject name = "ColorList"/>
63 </td>
64 </tr>
65
66 {{/code}}
67
68 WOD:
69
70 {{code}}
71
72 ColorList : WORadioButtonList {
73 list = colorList;
74 item = colorItemInList;
75 selection = selectedColor;
76 prefix = "&nbsp;<tt style='border: 1px solid #202020; background-color: ";
77 suffix = ";'>&nbsp;&nbsp;&nbsp;</tt>&nbsp;&nbsp;&nbsp;";
78 }
79
80 {{/code}}