Provides a container group for Radio components. The RadioGroup itself must be within a Form component. The Radio and RadioGroup components work together to update a property of an object, much like a more flexible version of a PropertySelection . This component should wrap around other Radio components.
Warning:RadioGroup components may not nest.
See also: org.apache.tapestry.form.RadioGroup , Option , PropertySelection , Radio , Select
Name | Type | Direction | Required | Default | Description |
---|---|---|---|---|---|
selected | Object | in-out | yes | Read during rendering to determine which Radio will be the default. Updated during rewinding (when the form is submitted) to indicate which radio button was selected by the user (null if no button was selected). | |
disabled | boolean | in | no | false | If true, then all contained Radio components will be disabled as well. |
displayName | string | in | no | The user-presentable name for the component, which will be used by a FieldLabel connected to the component. | |
validators | Array or collection of Validator , or Validator | in | no | The validators to apply to the component. In many cases, a "validators:" binding prefix should be used. |
Body: allowed
Informal parameters: forbidden
Reserved parameters: none
This RadioGroup example illustrates an order form where a user can select the order size.
<form jwcid="@Form" success="listener:doSubmit"> <span jwcid="@FieldLabel" field="component:size">Radio</span> <span jwcid="size@RadioGroup" selected="ognl:orderSize" displayName="Size" validators="validators:required"> <input type="radio" jwcid="@Radio" value="ognl:@com.myexample.OrderPage@SMALL"/> Small <input type="radio" jwcid="@Radio" value="ognl:@com.myexample.OrderPage@MEDIUM"/> Medium <input type="radio" jwcid="@Radio" value="ognl:@com.myexample.OrderPage@LARGE"/> Large <input type="submit" value="Order"/> </span> </form>
package com.myexample; import org.apache.tapestry.html.BasePage; public abstract class OrderPage extends BasePage { public final static Integer SMALL = new Integer(1); public final static Integer MEDIUM = new Integer(2); public final static Integer LARGE = new Integer(3); public abstract Integer getOrderSize(); public void doSubmit() { // process order } }