<radiogroup>

radio group enables a one-of-many selection

JavaScript: radiogroup

Extends Baselist

The <radiogroup> component encloses a list of <radiobutton>s. 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.

See Also:
Attributes

Attributes inherited from Basecomponent

doesenter, enabled, hasdefault, isdefault, style, styleable, text

Attributes inherited from Baseformitem

changed, ignoreform, onchanged, onvalue, rollbackvalue, submit, submitname

Attributes inherited from Baselist

dataoption, defaultselection, itemclassname, multiselect, toggleselected

Attributes inherited from Basevaluecomponent

value

Attributes inherited from Node

class, classroot, cloneManager, datapath, id, ignoreAttribute, ignoreplacement, immediateparent, initstage, name, nodeLevel, onconstruct, oninit, parent, placement, subnodes

Attributes inherited from View

aaactive, aadescription, aaname, aasilent, aatabindex, align, bgcolor, clickable, clickregion, clip, cursor, defaultplacement, fgcolor, focusable, focustrap, font, fontsize, fontstyle, frame, framesloadratio, hassetheight, hassetwidth, height, layout, loadratio, mask, onblur, onclick, ondata, ondblclick, onfocus, onkeydown, onkeyup, onmousedown, onmouseout, onmouseover, onmouseup, onselect, opacity, options, pixellock, play, resource, resourceheight, resourcewidth, rotation, selectiontype, showhandcursor, source, stretches, subviews, totalframes, unstretchedheight, unstretchedwidth, valign, visible, width, x, xoffset, y, yoffset


Methods

Methods inherited from basecomponent

doEnterDown, doEnterUp, doSpaceDown, doSpaceUp, setStyle, setTint, updateDefault

Methods inherited from baseformitem

applyData, commit, findForm, init, rollback, setChanged, setValue, toXML, updateData

Methods inherited from baselist

addItem, clearSelection, getItem, getItemAt, getNumItems, getSelection, getText, getValue, moveSelection, removeItem, removeItemAt, select, selectItem, selectItemAt, selectNext, selectPrev, setHilite

Methods inherited from LzNode

animate, applyConstraint, childOf, completeInstantiation, createChildren, dataBindAttribute, destroy, determinePlacement, getAttribute, getOption, getUID, lookupSourceLocator, searchImmediateSubnodes, searchSubnodes, setAttribute, setDatapath, setID, setName, setOption

Methods inherited from LzView

addProxyPolicy, addSubview, bringToFront, construct, containsPt, getAttributeRelative, getBounds, getColor, getColorTransform, getContextMenu, getCurrentTime, getDepthList, getHeight, getID3, getMouse, getPan, getTotalTime, getVolume, getWidth, measureHeight, measureWidth, play, releaseLayouts, removeProxyPolicy, searchParents, searchSubviews, seek, sendBehind, sendInFrontOf, sendToBack, setAAActive, setAADescription, setAAName, setAASilent, setAATabIndex, setAlign, setAttributeRelative, setBGColor, setClickable, setColor, setColorTransform, setContextMenu, setCursor, setHeight, setLayout, setOpacity, setPan, setPlay, setResource, setResourceNumber, setRotation, setShowHandCursor, setSource, setValign, setVisible, setVolume, setWidth, setX, setY, shouldYieldFocus, stop, stretchResource, unload, updateResourceSize


Events

Events inherited from LzNode

onconstruct, ondata, oninit

Events inherited from LzView

onaddsubresource, onaddsubview, onblur, onclick, ondblclick, onerror, onfocus, onframe, onheight, onlastframe, onload, onmousedown, onmousedragin, onmousedragout, onmouseout, onmouseover, onmouseup, onmouseupoutside, onopacity, onplay, onremovesubview, onstop, ontimeout, onwidth, onx, ony