Radio Component Index RenderBlock

RadioGroup
org.apache.tapestry.form.RadioGroup
Size   Regular  
  Large  
  Super  
 
Description
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.

See Also
Option, PropertySelection, Radio, Select
Parameters
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.
disabled boolean int no no If true, then all contained Radio components will be disabled as well.

Body: rendered
Informal parameters: forbidden
Reserved parameters: none
Examples

This RadioGroup example illustrates an order form where a user can select the order size. Note how the OrderPage.detach() method is used to reset the default selected Radio button to Medium.

The title border effect is achieved using the HTML <fieldset><legend>.. </legend>.. </fieldset> tags.

Order Size   Small
  Medium   
  Large

  
<form jwcid="@Form" listener='ognl:listeners.formSubmit'>
<table cellpadding="4" cellspacing="4">
 <tr><td>
   <fieldset><legend>Order Size</legend>
   <span jwcid="@RadioGroup" selected='ognl:orderSize'>
    <input type="radio" jwcid="@Radio" value='ognl:@OrderPage@SMALL'/> Small <br/>
    <input type="radio" jwcid="@Radio" value='ognl:@OrderPage@MEDIUM'/> Medium <br/>
    <input type="radio" jwcid="@Radio" value='ognl:@OrderPage@LARGE'/> Large <br/>
   </span>
   </fieldset>
 </td></tr>
 <tr align="right"><td><input type="submit" value="Order"></td></tr>
</table>
</form>

<property-specification name="orderSize" type="java.lang.Integer" initial-value="@OrderPage@MEDIUM"/>
public abstract 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 formSubmit(IRequestCycle cycle) { // process order } }

Radio Component Index RenderBlock