Creates a group of radio buttons. This is useful if you want to create a list of options from which the user may select only one choice.
Each radio button appears as an empty circle that is filled with a marker, such as a dot, when selected.
acclabel, active, bgcolor, border, borderinfo, focused, format, help, itemlocation, itemnext, itemprevious, label, labelbgcolor, labelborder, labelfontcolor, labelfontinfo, mouseover, next, previous, printbgcolor, printlabelbgcolor, printlabelfontcolor, printvisible, readonly, suppresslabel, value, visible, xformsenabled, xformsreadonly, xformsrequired, xformsvalid, xforms:select1
The following code creates a radiogroup with three choices: US Dollars, CDN Dollars, and Euro. The choices themselves are defined within the <xforms:select1> option.
<radiogroup sid="currency">
<xforms:select1 ref="selectedCurrency" appearance="full">
<xforms:label>Select the currency you accept:</xforms:label>
<xforms:item>
<xforms:label>US Dollars</xforms:label>
<xforms:value>USD</xforms:value>
</xforms:item>
<xforms:item>
<xforms:label>CDN Dollars</xforms:label>
<xforms:value>CDN</xforms:value>
</xforms:item>
<xforms:item>
<xforms:label>Euro</xforms:label>
<xforms:value>Euro</xforms:value>
</xforms:item>
</xforms:select1>
</radiogroup>
Alternatively, you could create the choices in your data model as follows:
<xforms:instance id="currency" xmlns="">
<data>
<choice show="US Dollars">USD</choice>
<choice show="CDN Dollars">CDN</choice>
<choice show="Euros">Euro</choice>
</data>
</xforms:instance>
In this case, use <xforms:itemset> to link to those choices, as illustrated by the following radiogroup:
<radiogroup sid="currencyType">
<xforms:select1 ref="selectedCurrency" appearance="full">
<xforms:label>Select your preferred currency for payment:</xforms:label>
<xforms:itemset nodeset="instance('currency')/choice">
<xforms:label ref="@show"></xforms:label>
<xforms:value ref="."></xforms:value>
</xforms:itemset>
</xforms:select1>
</radiogroup>
<xforms:itemset nodeset="instance('currency')/choice">
<xforms:label ref="@show"></xforms:label>
<xforms:value ref="."></xforms:value>
<xforms:extension>
<bgcolor compute="mouseover == 'on' ? 'blue' : 'green'"/>
</xforms:extension>
</xforms:itemset>
<xforms:extension>
<itemlocation>
<after compute="itemprevious"/>
</itemlocation>
</xforms:extension>
This will place each radio after its predecessor, except for the first radio, which is placed at the top left corner of the group. For the first radio, the after command is ignored because the radiogroup position is not set until after the contained radio items are positioned, and itemlocation keywords are ignored when they refer to items that have not been positioned.