Tobago Demo

Menu

Radio

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: <tc:selectOneRadio/> | <tc:selectItem/> | <tc:selectItems/>

Basics

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"/>

Inline

To display the radio buttons horizontally use the inline="true" attribute.

Images

Simple Usage

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}"/>

0

Ajax

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.

Free layout with <tc:selectReference>

First and second giant planets:
Discovered 1781:
Discovered 1846:

Free layout with group attribute

Work in progress! Decoding and validation is case of "group" is not implemented yet.
First and second giant planets:
Discovered 1781:
Discovered 1846:

Free layout with group attribute (JSF HTML tags - since JSF 2.3)

Attention! This example is only temporary for testing purpose. Does not currently work with Mojarra or MyFaces, but for different reasons.

© 2005-2023 Apache Software Foundation, Licensed under the Apache License, Version 2.0.