////
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements.  See the NOTICE file
distributed with this work for additional information
regarding copyright ownership.  The ASF licenses this file
to you under the Apache License, Version 2.0 (the
"License"); you may not use this file except in compliance
with the License.  You may obtain a copy of the License at

https://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing,
software distributed under the License is distributed on an
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, either express or implied.  See the License for the
specific language governing permissions and limitations
under the License.
////


== radioGroup



=== Purpose


Generates radio button groups


=== Examples


[source,xml]
----
<g:radioGroup name="myGroup" values="[1,2,3]" value="1">
<p><g:message code="${it.label}" />: ${it.radio}</p>
</g:radioGroup>
----

results in:

[source,html]
----
<p>Radio 1: <input type="radio" name="myGroup" value="1" checked="checked" /></p>
<p>Radio 2: <input type="radio" name="myGroup" value="2" /></p>
<p>Radio 3: <input type="radio" name="myGroup" value="3" /></p>
----

[source,xml]
----
<g:radioGroup name="lovesGrails"
              labels="['Yes!','Of course!','Always!']"
              values="[1,2,3]">
<p>${it.label} ${it.radio}</p>
</g:radioGroup>
----

results in:

[source,html]
----
<p>Yes! <input type="radio" name="lovesGrails" value="1" /></p>
<p>Of course! <input type="radio" name="lovesGrails" value="2" /></p>
<p>Always! <input type="radio" name="lovesGrails" value="3" /></p>
----


=== Description


The body of the tag contains the GSP to render for each value. Two variables are provided for use:

* `it.label` - the label for the current value
* `it.radio` - the radio button <input> tag for the current value

Attributes

* `name` (required) - The name of the group
* `values` (required) - The list of values for the radio buttons
* `value` (optional) - The selected value
* `labels` (optional) - Labels for each value contained in the `values` list. If this is omitted the label property on the iterator variable (see below) will default to 'Radio ' + value.

