RadioGroup

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

Parameters

Name Type Required Default Description
selected Object 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 no false If true, then all contained Radio components will be disabled as well.
displayName string 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 no The validators to apply to the component. Something along the lines of: validators:required .



See also: Validation
translator Translator no The translator to use when displaying and parsing the date.



See also: Validation

Body: allowed

Informal parameters: forbidden

Reserved parameters: none

Examples

This RadioGroup example illustrates an order form where a user can select the order size.

<form jwcid="@Form" success="listener:doSubmit">
 <label jwcid="@FieldLabel" field="component:size">Radio</label>
 <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

  }

}