@Import(stylesheet="${tapestry.datepicker}/css/datepicker.css", module="t5/core/datefield") @Events(value="validate") public class DateField extends AbstractField
Name | Type | Flags | Default | Default Prefix |
---|---|---|---|---|
format | java. | Required, Not Null | literal | |
The format used to format and parse dates. This is typically specified as a string which is coerced to a DateFormat. You should be aware that using a date format with a two digit year is problematic: Java (not Tapestry) may get confused about the century. | ||||
hideTextField | boolean | prop | ||
If true, then the text field will be hidden, and only the icon for the date picker will be visible. The default is false. | ||||
icon | org. | asset | ||
Icon used for the date field trigger button. This was used in Tapestry 5.3 and earlier and is now ignored. | ||||
lenient | boolean | Since 5.4 | prop | |
When the format parameter isn't used, this parameter defines whether the DateFormat created by this component will be lenient or not. The default value of this parameter is the value of the org.apache.tapestry5.SymbolConstants#LENIENT_DATE_FORMAT symbol. | ||||
messages | org. | Since 5.2.0.0 | componentResources. | prop |
Used to override the component's message catalog. | ||||
validate | org. | validate | ||
The object that will perform input validation (which occurs after translation). The translate binding prefix is generally used to provide this object in a declarative fashion. | ||||
value | java. | Required | prop | |
The value parameter of a DateField must be a java.util.Date. |
Name | Description |
---|---|
validate |
The DateField component is very easy to use, all the JavaScript is generated for you. Then end result looks like:
Note: these screenshots are out of date, and reflect an earlier version of Tapestry and a different third-party JavaScript calendar than is currently available.
Clicking the icon raises the popup calendar:
<html xmlns:t="http://tapestry.apache.org/schema/tapestry_5_0_0.xsd"> <body> <t:form> <div class="t-beaneditor"> <div class="t-beaneditrow"> <t:label for="date"/> <t:datefield t:id="date"/> </div> <div class="t-beaneditrow"> <input type="submit" value="Update"/> </div> </div> </t:form> </body> </html>
The use of the extra
<t:datefield>
element is all that's really necessary.
clientId, cssClass, decorator, defaultProvider, disabled, environment, fieldValidationSupport, formSupport, javaScriptSupport, label, request, resources, validationTracker
Constructor and Description |
---|
DateField() |
Modifier and Type | Method and Description |
---|---|
boolean |
isRequired()
Returns false; most components do not support declarative validation.
|
protected void |
processSubmission(String controlName)
Method implemented by subclasses to actually do the work of processing the submission of the form.
|
decorateInsideField, getClientId, getControlName, getLabel, isDisabled, putPropertyNameIntoBeanValidationContext, removePropertyNameFromBeanValidationContext, setDecorator, setFormSupport
public DateField()
protected void processSubmission(String controlName)
AbstractField
disabled
.processSubmission
in class AbstractField
controlName
- the control name of the rendered element (used to find the correct parameter in the request)public boolean isRequired()
AbstractField
isRequired
in interface Field
isRequired
in class AbstractField
Copyright © 2003-2013 The Apache Software Foundation.