Name

radiogroup — Enables a one-of-many selection of its children.

Synopsis

LZX: radiogroup
JavaScript: lz.radiogroup
Type: Class
Access: public
Topic: Components.Laszlo Components
Declared in: lps/components/lz/radio.lzx

Description

The radiogroup component encloses a list of radiobuttons. It ensures that a single item is selected at a time. Initially it will select the first item in a group if none is set to be selected. By default the radio buttons are spaced vertically.

In the following example, the second radio button is selected. The text that appears is separate from the value that is represented by each item. In this example, group1.value is 2.

<canvas width="200" height="100">
              <radiogroup id="group1">
                <radiobutton value="1" text="one"/>
                <radiobutton value="2" text="two" selected="true"/>
                <radiobutton value="3" text="three"/>
              </radiogroup>
            </canvas>

You can use radio group with your own layout attribute, by overriding the view layout attribute. The example below uses a wrapping layout to create two columns of radio buttons. Note that a height must be given to indicate to the layout where to wrap.

<canvas width="200" height="100">
              <radiogroup height="60" layout="class:wrappinglayout; axis:y">
                <radiobutton value="1" text="one"/>
                <radiobutton value="2" text="two"/>
                <radiobutton value="3" text="three"/>
                <radiobutton value="4" text="four"/>
                <radiobutton value="5" text="five"/>
                <radiobutton value="6" text="six"/>
              </radiogroup>
            </canvas>

A radiogroup can contain a set of any baselistitem. To make radio buttons with a different look and feel, create a subclass of baselistitem to use instead of the radiobutton class.

Superclass Chain

node (LzNode) » view (LzView) » basecomponent » basevaluecomponent » baseformitem » baselist » radiogroup

Known Subclasses

Details

Properties (2)

layout
<attribute name="layout" value="class: simplelayout; axis: y; spacing:5" />
public var layout;
The layout to use for the radiogroup. The default is simplelayout with spacing 5. Note: if you use another layout, be sure to include the layout library file.
value
<attribute name="value" value="null" />
private var value;

Methods (2)

applyData()
<method name="applyData" args="d" />
private function applyData(d);
_setvalue()
<method name="_setvalue" args="val" />
private function _setvalue(val);

Events (1)

onvalue
<attribute name="onvalue" />
private event onvalue;

LZX Synopsis

<class name="lz.radiogroup" extends=" lz.baselist ">
  <attribute name=" layout " value="class: simplelayout; axis: y; spacing:5" />
  <attribute name=" value " value="null" />
  <method name=" applyData " args="d" />
  <event name=" onvalue " />
  <method name=" _setvalue " args="val" />
</class>

JavaScript Synopsis

public lz.radiogroup extends  lz.baselist  {
  public var layout ;
  private var value ;
  prototype private function applyData (d);
  prototype private event onvalue ;
  prototype private function _setvalue (val);
}