| <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> |
| <!-- $Id$ --> |
| <html> |
| <head> |
| <title>RadioGroup</title> |
| <link rel="stylesheet" type="text/css" href="Tapestry.css" title="style"> |
| </head> |
| |
| <body> |
| <table border="0" cellpadding="0" cellspacing="0" width="100%"> |
| <tr> |
| <td align="left"><A href="Radio.html"><IMG alt=Radio src="common-images/prev.png"></a></td> |
| <td align="middle"><A href="index.html"><IMG alt="Component Index" src="common-images/home.png" ></a></td> |
| <td align="right"><A href="RenderBlock.html"><IMG alt=RenderBlock src="common-images/next.png"></a></td> |
| <tr> |
| <tr> |
| <td colspan="3"><hr></td> |
| </tr> |
| <tr> |
| <td colspan="3"> |
| <table border="0" cellpadding="4" cellspacing="4" width="100%"> |
| |
| <tr valign="top"> |
| <td> |
| <table> |
| <tr> |
| <td><font size="+2"><b>RadioGroup</b></font></td> |
| </tr> |
| <tr> |
| <td> |
| <A href="../api/org/apache/tapestry/form/RadioGroup.html">org.apache.tapestry.form.RadioGroup</a> |
| </td> |
| </tr> |
| </table> |
| </td> |
| <td> |
| <table align="right" valign="middle" bgcolor="#c0c0c0" cellpadding="8"> |
| <tr> |
| <td> |
| <fieldset><legend>Size</legend> |
| <input type="radio" checked name="1">Regular <br> |
| <input type="radio" name="1">Large <br> |
| <input type="radio" name="1">Super <br> |
| </fieldset> |
| </td> |
| </tr> |
| </table> |
| </td> |
| </tr> |
| |
| <tr valign="center"> |
| <td colspan="2"> </td> |
| </tr> |
| |
| <tr> |
| <td colspan="2"> |
| <b>Description</b> |
| <br> |
| Provides a container group for <A href="Radio.html">Radio</a> components. The |
| RadioGroup itself must be within a <A href="Form.html">Form</a> component. The |
| Radio and RadioGroup components work together to update a property of an |
| object, much like a more flexible version of a |
| <A href="PropertySelection.html">PropertySelection</a>. |
| <p> |
| This component should wrap around other <A href="Radio.html">Radio</a> components.</p> |
| |
| </td> |
| </tr> |
| |
| <tr> |
| <td colspan="2"> |
| <b>See Also</b> |
| <br> |
| <A href="Option.html">Option</a>, |
| <A href="PropertySelection.html">PropertySelection</a>, |
| <A href="Radio.html">Radio</a>, |
| <A href="Select.html">Select</a> |
| </td> |
| </tr> |
| |
| <tr> |
| <td colspan="2"> |
| <b>Parameters</b> |
| <br> |
| <table border="1" cellpadding="4" cellspacing="4" class="parameters"> |
| <tr> |
| <th>Name</th> |
| <th>Type</th> |
| <th>Direction</th> |
| <th>Required</th> |
| <th>Default</th> |
| <th>Description</th> |
| </tr> |
| <tr> |
| <td>selected</td> |
| <td>Object</td> |
| <td>in-out</td> |
| <td>yes</td> |
| <td> </td> |
| <td> |
| 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. |
| </td> |
| </tr> |
| <tr> |
| <td>disabled</td> |
| <td>boolean</td> |
| <td>int</td> |
| <td>no</td> |
| <td>no</td> |
| <td> |
| If true, then all contained Radio components will be disabled as well. |
| </td> |
| </tr> |
| </table> |
| <BR> |
| Body: <STRONG>rendered</STRONG><BR> |
| Informal parameters: <STRONG>forbidden</STRONG><br> |
| Reserved parameters: <EM>none</EM> |
| </td> |
| </tr> |
| |
| <tr> |
| <td colspan="2"> |
| <b>Examples</b> |
| <p> |
| This RadioGroup example illustrates an order form where a user can select the |
| order size. Note how the <tt>OrderPage.detach()</tt> method is used to reset the default |
| selected Radio button to Medium. |
| <p/> |
| The title border effect is achieved using the HTML |
| <fieldset><legend>.. </legend>.. </fieldset> tags. |
| <p/> |
| |
| <table class="examples" cellpadding="4" cellspacing="4"> |
| <tr> |
| <td> |
| <fieldset><legend>Order Size</legend> |
| <input type="radio" name="2"/>Small<br> |
| <input type="radio" checked name="2"/>Medium <br> |
| <input type="radio" name="2"/>Large<br> |
| </fieldset> |
| </td> |
| </tr> |
| <tr align="right"> |
| <td><input type="submit" value="Order"></td> |
| </tr> |
| </table> |
| <pre> |
| <form jwcid="@<a href="Form.html">Form</a>" listener='ognl:listeners.formSubmit'> |
| <table cellpadding="4" cellspacing="4"> |
| <tr><td> |
| <fieldset><legend>Order Size</legend> |
| <span jwcid="<span class="jwcid">@<a href="RadioGroup.html">RadioGroup</a></span>" selected='ognl:orderSize'> |
| <input type="radio" jwcid="@<a href="Radio.html">Radio</a>" value='ognl:@OrderPage@SMALL'/> Small <br/> |
| <input type="radio" jwcid="@<a href="Radio.html">Radio</a>" value='ognl:@OrderPage@MEDIUM'/> Medium <br/> |
| <input type="radio" jwcid="@<a href="Radio.html">Radio</a>" 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"/><br> |
| 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 |
| } |
| } |
| </pre> |
| </td> |
| </tr></table> |
| </td></tr> |
| <tr> |
| <td colspan="3"><hr></td> |
| </tr> |
| <tr> |
| <td align="left"><A href="Radio.html"><IMG alt=Radio src="common-images/prev.png"></a></td> |
| <td align="middle"><A href="index.html"><IMG alt="Component Index" src="common-images/home.png" ></a></td> |
| <td align="right"><A href="RenderBlock.html"><IMG alt=RenderBlock src="common-images/next.png"></a></td> |
| </tr> |
| </table> |
| |
| </body> |
| </html> |