Wiki source code of WORadioButtonList

Version 6.1 by Klaus Berkling on 2012/03/03 17:43

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 **bold**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.**bold**
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 A not so quite simple example.
46
47 Java:
48
49 {{code}}
50
51 public NSArray<String> colorList = new NSArray<String>("#ffffff","#2F64DA","#37B11B","#E71E27","#F38B1E","#BE33BB","#6138AF");
52 public String selectedColor = "#ffffff";
53 public String colorItemInList;
54
55 {{/code}}
56
57 HTML:
58
59 {{code}}
60
61 <tr>
62 <th>Color</th>
63 <td nowrap class="radiobuttons-horizontal">
64 <webobject name = "ColorList"/>
65 </td>
66 </tr>
67
68 {{/code}}
69
70 WOD:
71
72 {{code}}
73
74 ColorList : WORadioButtonList {
75 list = colorList;
76 item = colorItemInList;
77 selection = selectedColor;
78 prefix = "&nbsp;<tt style='border: 1px solid #202020; background-color: ";
79 suffix = ";'>&nbsp;&nbsp;&nbsp;</tt>&nbsp;&nbsp;&nbsp;";
80 }
81
82 {{/code}}