The radiobuttons tag

In this section, you will learn about radiobuttons tag of Spring form tag library.

The radiobuttons tag

--Ads--

The radiobuttons tag

In this section, you will learn about radiobuttons tag of Spring form tag library.

A radio button is a type of graphical user interface element that allows the user to choose only one of a predefined set of options.

Sometimes you prefer to pass in the available options as a runtime variable. You can do this using radiobuttons tags. You can pass in an Array, a List or a Map containing the available options in the "items" property of radiobuttons tag. You can do this as follows :

<tr>
	<td>Sex:</td>
	<td><form:radiobuttons path="sex" items="${sexOptions}"/></td>
</tr>

Here, sexOptions is a List. In the case where you use a Map, the map entry key will be used as the value and the map entry's value will be used as the label to be displayed.