blob: 258468884e837126a86b476032cefe5b4bbd22df [file] [log] [blame]
<span jwcid="@Border">
<h2>Fields / Form validation</h2>
Tapestry includes a number of form-related components. Tapestry components are
responsible for reading properties when a page is rendered, to supply default values,
and writing properties when the form is submitted; it is never necesssary to write
code to directly read HTTP parameters.
<p>
<form jwcid="valid@Form" focus="false">
<input jwcid="inputEnabled"/> <em>Enable Client Side Validation</em>
</form>
<p>Input field components can perform validations on the client-side, triggered
by the user submitting the form. The checkbox above enables or disables
this feature. Input is always rechecked on the server-side (in case the client
doesn't support JavaScript).
<span jwcid="showError"/>
<form jwcid="@Form" success="listener:doSubmit" delegate="bean:delegate"
clientValidationEnabled="ognl:clientValidationEnabled" >
<table class="form">
<tr>
<th><label jwcid="@FieldLabel" accesskey="d" field="component:inputDate"/></th>
<td><input jwcid="inputDate"/></td>
</tr>
<tr>
<th><label jwcid="@FieldLabel" accesskey="i" field="component:inputInt"/></th>
<td><input jwcid="inputInt"/></td>
</tr>
<tr>
<th><label jwcid="@FieldLabel" field="component:inputDouble"/></th>
<td><input jwcid="inputDouble"/></td>
</tr>
<tr>
<th><label jwcid="@FieldLabel" accesskey="b" field="component:inputBigDecimal"/></th>
<td><input jwcid="inputBigDecimal"/></td>
</tr>
<tr>
<th><label jwcid="@FieldLabel" accesskey="l" field="component:inputLong"/></th>
<td><input jwcid="inputLong"/></td>
</tr>
<tr>
<th><label jwcid="@FieldLabel" accesskey="s" field="component:inputString"/></th>
<td><input jwcid="inputString"/></td>
</tr>
<tr>
<th><label jwcid="@FieldLabel" accesskey="e" field="component:inputEmail"/></th>
<td><input jwcid="inputEmail"/></td>
</tr>
<tr>
<th><label jwcid="@FieldLabel" accessKey="z" field="component:zipCode"/></th>
<td><input jwcid="zipCode" /></td>
</tr>
<tr>
<th><label for="phone" accessKey="p">Phone</label></th>
<td><input jwcid="phone" /></td>
</tr>
<tr>
<th><label jwcid="@FieldLabel" accessKey="a" field="component:ipaddress" /></th>
<td><input jwcid="ipaddress" /></td>
</tr>
<tr>
<th><label jwcid="@FieldLabel" accesskey="a" field="component:textArea"/></th>
<td><input jwcid="textArea" cols="33" rows="4" /></td>
</tr>
<tr>
<th><label jwcid="@FieldLabel" field="component:choose" /></th>
<td>
<div jwcid="choose@RadioGroup" selected="ognl:visit.choice" displayName="Choose" validators="validators:required" >
<input jwcid="@Radio" value="literal:2" />&nbsp;Yes&nbsp;
<input jwcid="@Radio" value="literal:4" />&nbsp;No
</div>
</td>
</tr>
<tr>
<td> </td>
<td><input jwcid="continue@ImageSubmit" image="asset:continue"/></td>
</tr>
<tr>
<td></td>
<td>
Or, use a LinkSubmit component:
<a jwcid="continueLink@LinkSubmit" listener="listener:doByLink">Continue</a>
</td>
</tr>
</table>
</form>
</span>