blob: fc34dcc02d0b3d9dc89f9192c3f4257bf8ef4e81 [file] [log] [blame]
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<!-- $Id$ -->
<html>
<head>
<title>Checkbox</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="Button.html"><IMG alt="Button" 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="Conditional.html"><IMG alt=Conditional 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>Checkbox</b></font></td>
</tr>
<tr>
<td>
<A href="../api/org/apache/tapestry/form/Checkbox.html">org.apache.tapestry.form.Checkbox</a>
</td>
</tr>
</table>
</td>
<td>
<table align="right" valign="middle" bgcolor="#c0c0c0" cellspacing="8">
<tr>
<td>
<input type="checkbox" checked>checkbox
</td>
</tr>
</table>
</td>
</tr>
<tr valign="center">
<td colspan="2">&nbsp;</td>
</tr>
<tr>
<td colspan="2">
<b>Description</b>
<br>
Provides a HTML checkbox form element &lt;input type="checkbox"&gt;.
The Checkbox component must be wrapped by a <A href="Form.html">Form</a>.
</td>
</tr>
<tr>
<td colspan="2">
<b>See Also</b>
<br>
<A href="Form.html">Form</a>, <A href="Radio.html">Radio</a>,
<A href="RadioGroup.html">RadioGroup</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>boolean</td>
<td>in-out</td>
<td>yes</td>
<td>&nbsp;</td>
<td>Indicates whether the checkbox is selected or not.
Corresponds to the "checked" HTML attribute.
</td>
</tr>
<tr>
<td>disabled</td>
<td>boolean</td>
<td>in</td>
<td>no</td>
<td>false</td>
<td>Controls whether the text field is active or not. If disabled, then
any value that comes up when the form is submitted is ignored.
Corresponds to the "disabled" HTML attribute.
</td>
</tr>
</table>
<P>Body: <STRONG>removed<BR></STRONG>Informal parameters:
<STRONG>allowed</STRONG>
<br>
Reserved parameters:
"type", "checked", "name" </P>
</td>
</tr>
<tr>
<td colspan="2">
<b>Examples</b>
<p>
Provides a checkbox for the user contact a sales representative.
<p>
<table class="examples" cellspacing="8">
<tr>
<td>
<input type="checkbox" checked> Contact Sales Rep
</td>
</tr>
</table>
<pre>
&lt;form jwcid="@<a href="Form.html">Form</a>" listener="ognl:listeners.formSubmit"&gt;
&lt;input type="checkbox" jwcid="<span class="jwcid">@<a href="Checkbox.html">Checkbox</a></span>" selected="ognl:contactRep" disabled="ognl:staff"/&gt; Contact Sales Rep
&lt;/form&gt;
&lt;property-specification name=&quot;contactRep&quot; type=&quot;boolean&quot; persistent=&quot;yes&quot;/&gt;<br>&lt;property-specification name=&quot;staff&quot; type=&quot;boolean&quot;/&gt;<br>
public abstract class EnquiryPage extends BasePage {
public abstract boolean isContactRep();
public abstract void setContactRep(boolean value);
public abstract boolean isStaff();
public abstract void setStaff(boolean staff);
public void formSubmit(RequestCycle cycle) {
if (isContactRep()) {
// Process contact a sales representative request
}
}
}
</pre>
</td>
</tr></table>
</td></tr>
<tr>
<td colspan="3"><hr></td>
</tr>
<tr>
<td align="left"><A href="Button.html"><IMG alt="Button" 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="Conditional.html"><IMG alt=Conditional src="common-images/next.png"></a></td>
</tr>
</table>
</body>
</html>