A group of radiobuttons will be created with the <tc:selectOneRadio/>
tag.
Static entries are added with <tc:selectItem/>
tag.
A list from a controller is added with
<tc:selectItems value="\#{controller.list}"/>
.
Tag Library Documentation:
Radiobutton group with a label. The last item is disabled.
Also the label set on top with the labelLayout
attribute.
<tc:selectOneRadio label="Radio Group" labelLayout="top"/>
To display the radio buttons horizontally use the inline="true"
attribute.
Add number1 to number2 or subtract number2 from number1.
The radiobuttons are hardcoded with
<tc:selectItem itemLabel="1" itemValue="1"/>
.
The buttons trigger an action in the controller:
<tc:button label="Addition" action="\#{selectOneRadioController.add}"/>
Select a planet on the left. One the right side, you can select one of the moons.
The planets are added with
<f:selectItems value="\#{selectOneRadioController.planets}"/>
.
The radiogroup of the planets also contain a
<f:ajax render="moonradio">
element,
which allows to rerender the radiogroup with the ID 'moonradio' every time, the value changed in the
planet-radiogroup.