|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object net.sf.click.control.AbstractControl net.sf.click.control.Field net.sf.click.control.TextField net.sf.click.extras.control.DateField
Provides a Date Field control: <input type='text'><img>.
Date Field |
<html> <head> $cssImports </head> <body> $form </body> </html> $jsImportsThe default Calendar style is 'system' which has a similar appearance to the Windows Calendar control. The JSCalendar styles include:
Field Summary | |
protected String |
calendarPattern
The JavaScript DHTML Calendar pattern. |
protected Date |
date
The DateField's date value. |
protected SimpleDateFormat |
dateFormat
The date format. |
protected String |
formatPattern
The date format pattern value. |
static String |
HTML_IMPORTS
The HTML import statements. |
protected boolean |
showTime
The Calendar popup show time display bar flag. |
protected String |
style
The JSCalendar CSS style, default value: system. |
Fields inherited from class net.sf.click.control.TextField |
maxLength, minLength, size, VALIDATE_TEXTFIELD_FUNCTION |
Fields inherited from class net.sf.click.control.Field |
disabled, error, focus, form, help, label, readonly, required, tabindex, title, validate, value |
Fields inherited from class net.sf.click.control.AbstractControl |
actionListener, attributes, listener, listenerMethod, messages, name, parent, styles |
Fields inherited from interface net.sf.click.Control |
CONTROL_MESSAGES |
Constructor Summary | |
DateField()
Create a Date Field with no name defined. |
|
DateField(String name)
Construct the Date Field with the given name. |
|
DateField(String name,
boolean required)
Construct the Date Field with the given name and required status. |
|
DateField(String name,
String label)
Construct the Date Field with the given name and label. |
|
DateField(String name,
String label,
boolean required)
Construct the Date Field with the given name, label and required status. |
|
DateField(String name,
String label,
int size)
Construct the Date Field with the given name, label and size. |
|
DateField(String name,
String label,
int size,
boolean required)
Construct the Date Field with the given name, label, size and required status. |
Method Summary | |
String |
getCalendarPattern()
Return the JavaScript DHTML Calendar pattern. |
Date |
getDate()
Return the field Date value, or null if value was empty or a parsing error occurred. |
SimpleDateFormat |
getDateFormat()
Return the SimpleDateFormat for the formatPattern
property. |
protected int |
getFirstDayOfWeek()
Return the first day of the week. |
String |
getFormatPattern()
Return the SimpleDateFormat pattern. |
String |
getHtmlImports()
Return the DateField calendar.js and calendar-{lang}.js includes. |
protected Locale |
getLocale()
Returns the Locale that should be used in this control. |
boolean |
getShowTime()
Return true if the DHTML Calendar popup will show the time display bar. |
String |
getStyle()
Return the JSCalendar CSS style. |
Timestamp |
getTimestamp()
Return the Timestamp value, or null if value was empty or a parsing error occured. |
Object |
getValueObject()
Return the field Date value, or null if value was empty or a parsing error occured. |
void |
onDeploy(ServletContext servletContext)
Deploy the Calendar Javascript and CSS resources to the web app directory click/calendar. |
protected String |
parseDateFormatPattern(String pattern)
Return the JavaScript Calendar pattern for the given Java DateFormat pattern. |
void |
render(HtmlStringBuffer buffer)
Render the HTML representation of the DateField. |
void |
setDate(Date date)
Set the field Date value. |
void |
setFormatPattern(String pattern)
Set the SimpleDateFormat pattern. |
void |
setName(String name)
|
void |
setShowTime(boolean showTime)
Set the DHTML Calendar popup show the time display bar flag. |
void |
setStyle(String style)
Set the JSCalendar CSS style. |
void |
setValue(String value)
Set the DateField value. |
void |
setValueObject(Object object)
Set the date value of the field using the given object. |
void |
validate()
Validate the DateField request submission. |
Methods inherited from class net.sf.click.control.TextField |
getControlSizeEst, getMaxLength, getMinLength, getSize, getTag, getType, getValidationJavaScript, setMaxLength, setMinLength, setSize |
Methods inherited from class net.sf.click.control.Field |
bindRequestValue, getError, getErrorLabel, getFocus, getFocusJavaScript, getForm, getHelp, getId, getLabel, getRequestValue, getTabIndex, getTextAlign, getTitle, getValidate, getValue, getWidth, isDisabled, isHidden, isReadonly, isRequired, isValid, onInit, onProcess, setDisabled, setError, setErrorMessage, setErrorMessage, setErrorMessage, setErrorMessage, setFocus, setForm, setHelp, setLabel, setListener, setParent, setReadonly, setRequired, setTabIndex, setTextAlign, setTitle, setValidate, setWidth |
Methods inherited from class net.sf.click.control.AbstractControl |
addStyleClass, appendAttributes, getActionListener, getAttribute, getAttributes, getContext, getMessage, getMessage, getMessage, getMessages, getName, getPage, getParent, getStyle, getStyles, hasAttribute, hasAttributes, hasStyles, onDestroy, onRender, registerActionEvent, removeStyleClass, renderTagBegin, renderTagEnd, setActionListener, setAttribute, setId, setStyle, toString |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
public static final String HTML_IMPORTS
protected Date date
protected String calendarPattern
protected SimpleDateFormat dateFormat
protected String formatPattern
protected boolean showTime
protected String style
Constructor Detail |
public DateField(String name)
name
- the name of the fieldpublic DateField(String name, String label)
name
- the name of the fieldlabel
- the label of the fieldpublic DateField(String name, boolean required)
name
- the name of the fieldrequired
- the field required statuspublic DateField(String name, String label, boolean required)
name
- the name of the fieldlabel
- the label of the fieldrequired
- the field required statuspublic DateField(String name, String label, int size)
name
- the name of the fieldlabel
- the label of the fieldsize
- the size of the fieldpublic DateField(String name, String label, int size, boolean required)
name
- the name of the fieldlabel
- the label of the fieldsize
- the size of the fieldrequired
- the field required statuspublic DateField()
Method Detail |
public String getCalendarPattern()
public Date getDate()
public void setDate(Date date)
date
- the Date value to setpublic SimpleDateFormat getDateFormat()
formatPattern
property.
public String getFormatPattern()
public void setFormatPattern(String pattern)
Letter | Date or Time Component | Presentation | Examples |
---|---|---|---|
G
| Era designator | Text | AD
|
y
| Year | Year | 1996 ; 96
|
M
| Month in year | Month | July ; Jul ; 07
|
w
| Week in year | Number | 27
|
W
| Week in month | Number | 2
|
D
| Day in year | Number | 189
|
d
| Day in month | Number | 10
|
F
| Day of week in month | Number | 2
|
E
| Day in week | Text | Tuesday ; Tue
|
a
| Am/pm marker | Text | PM
|
H
| Hour in day (0-23) | Number | 0
|
k
| Hour in day (1-24) | Number | 24
|
K
| Hour in am/pm (0-11) | Number | 0
|
h
| Hour in am/pm (1-12) | Number | 12
|
m
| Minute in hour | Number | 30
|
s
| Second in minute | Number | 55
|
S
| Millisecond | Number | 978
|
z
| Time zone | General time zone | Pacific Standard Time ; PST ; GMT-08:00
|
Z
| Time zone | RFC 822 time zone | -0800
|
pattern
- the SimpleDateFormat patternpublic String getHtmlImports()
public void setName(String name)
name
- of the control
IllegalArgumentException
- if the name is nullAbstractControl.setName(String)
public Timestamp getTimestamp()
public boolean getShowTime()
public void setShowTime(boolean showTime)
showTime
- the flag to show the Calendar time display barpublic String getStyle()
public void setStyle(String style)
style
- the JSCalendar CSS stylepublic void setValue(String value)
value
- the DateField valuepublic Object getValueObject()
public void setValueObject(Object object)
object
- the object value to setpublic void onDeploy(ServletContext servletContext)
servletContext
- the servlet contextpublic void render(HtmlStringBuffer buffer)
buffer
- the specified buffer to render the control's output toAbstractControl.toString()
public void validate()
- /click-control.properties
- field-maxlength-error
- field-minlength-error
- field-required-error
- /net/sf/click/extras/control/DateField.properties
- date-format-error
protected int getFirstDayOfWeek()
protected Locale getLocale()
protected String parseDateFormatPattern(String pattern)
pattern
- the Java DateFormat pattern
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |