WORadioButtonList

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

Introduction

WORadioButtonList displays a list of radio buttons. The user can make a selection that is then returned selection object.

Usage

In the WOD File:


WORadioButtonList {
 list = ObjectsList;
 item = ObjectItemInList;
 displayString = ObjectItemInList.displayString;
 [value = valueOfInputTag;]
 [index = ObjectListIndex;]
 [prefix = prefixHTMLString;]
 [suffix = suffixHTMLString;]
 [selection = selectedObjectInList;]
 [name = aName;]
 [disabled = disabledList;]
 [escapeHTML = renderDisplayStringAsHTML;]
}

Bindings

list

An array of objects

item

An element from the list array

displayString

A string used as the label for the radio button. If there is no displayString the value is used

value

The value in INPUT TYPE="radio" VAUE="aValue"

index

Index of the current integration of the list array

prefix

HTML prefix to the displayString

suffix

HTML suffix to the displayString

selection

The selected object from the list array

name

The name in INPUT tag

disabled

If true then the radio button is disabled

escapeHTML

Rendered the displayString as HTML

Example

A not so quite simple example.

Java:


public NSArray<String> colorList = new NSArray<String>("#ffffff","#2F64DA","#37B11B","#E71E27","#F38B1E","#BE33BB","#6138AF");
public String selectedColor = "#ffffff";
public String colorItemInList;

HTML:


<tr>
<th>Color</th>
<td nowrap class="radiobuttons-horizontal">
<webobject name = "ColorList"/>
</td>
</tr>

WOD:


ColorList : WORadioButtonList {
list = colorList;
item = colorItemInList;
selection = selectedColor;
prefix = "&nbsp;<tt style='border: 1px solid #202020; background-color: ";
suffix = ";'
>&nbsp;&nbsp;&nbsp;</tt>&nbsp;&nbsp;&nbsp;";
}