|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjavax.faces.component.UIComponent
javax.faces.component.UIComponentBase
javax.faces.component.UIOutput
javax.faces.component.UIInput
com.sun.webui.jsf.component.WebuiInput
com.sun.webui.jsf.component.HiddenField
com.sun.webui.jsf.component.Field
com.sun.webui.jsf.component.TextField
com.sun.webui.jsf.component.Calendar
public class Calendar
The Calendar component is used to allow a user to select a date.
Field Summary | |
---|---|
static java.lang.String |
DATE_PICKER_LINK_FACET
|
static java.lang.String |
PATTERN_ID
|
static java.lang.String |
TEXT_FIELD_FACET
|
Fields inherited from class com.sun.webui.jsf.component.Field |
---|
INPUT_ID, LABEL_FACET, LABEL_ID, READONLY_FACET, READONLY_ID |
Fields inherited from class javax.faces.component.UIInput |
---|
COMPONENT_FAMILY, COMPONENT_TYPE, CONVERSION_MESSAGE_ID, REQUIRED_MESSAGE_ID, UPDATE_MESSAGE_ID |
Fields inherited from interface javax.faces.component.NamingContainer |
---|
SEPARATOR_CHAR |
Constructor Summary | |
---|---|
Calendar()
Creates a new instance of Calendar |
Method Summary | |
---|---|
javax.faces.convert.Converter |
getConverter()
|
java.text.DateFormat |
getDateFormat()
|
java.lang.String |
getDateFormatPattern()
The date format pattern to use (i.e. |
java.lang.String |
getDateFormatPatternHelp()
A message located below the textfield for the date.Indicates which string format to use when entering a date as text into the textfield. |
com.sun.webui.jsf.component.CalendarMonth |
getDatePicker()
|
ImageHyperlink |
getDatePickerLink(javax.faces.context.FacesContext context)
Deprecated. |
java.lang.String |
getFamily()
Return the family for this component. |
java.util.Date |
getFirstAvailableDate()
|
java.lang.String |
getJavaScriptObjectName(javax.faces.context.FacesContext context)
|
java.lang.String |
getLabeledElementId(javax.faces.context.FacesContext context)
Returns the absolute ID of an HTML element suitable for use as the value of an HTML LABEL element's for attribute. |
java.util.Date |
getLastAvailableDate()
|
java.util.Date |
getMaxDate()
A java.util.Date object representing the last
selectable day. |
int |
getMaxLength()
The maximum number of characters that can be entered for this field. |
java.util.Date |
getMinDate()
A java.util.Date object representing the first
selectable day. |
java.lang.String |
getReadOnlyValueString(javax.faces.context.FacesContext context)
Return the value to be rendered as a string when the component is readOnly. |
java.lang.String |
getRendererType()
Returns the renderer type for the component. |
java.util.Date |
getSelectedDate()
A java.util.Date object representing the currently
selected calendar date. |
java.lang.Object |
getText()
Literal value to be rendered in this input field. |
java.util.TimeZone |
getTimeZone()
The java.util.TimeZone that is used with the calendar
component. |
javax.el.ValueExpression |
getValueExpression(java.lang.String name)
Return the ValueExpression stored for the
specified name (if any), respecting any property aliases. |
boolean |
isTrim()
Flag indicating that any leading and trailing blanks will be trimmed prior to conversion to the destination data type. |
void |
restoreState(javax.faces.context.FacesContext _context,
java.lang.Object _state)
Restore the state of this component. |
java.lang.Object |
saveState(javax.faces.context.FacesContext _context)
Save the state of this component. |
void |
setDateFormatPattern(java.lang.String dateFormatPattern)
Update the datePicker with an explicitly set date format pattern. |
void |
setDateFormatPatternHelp(java.lang.String dateFormatPatternHelp)
A message located below the textfield for the date.Indicates which string format to use when entering a date as text into the textfield. |
void |
setMaxDate(java.util.Date maxDate)
A java.util.Date object representing the last
selectable day. |
void |
setMinDate(java.util.Date minDate)
A java.util.Date object representing the first
selectable day. |
void |
setRequired(boolean required)
Flag indicating that an input value for this field is mandatory, and failure to provide one will trigger a validation error. |
void |
setSelectedDate(java.util.Date selectedDate)
A java.util.Date object representing the currently
selected calendar date. |
void |
setTimeZone(java.util.TimeZone timeZone)
Update the datePicker with an explicitly set time zone. |
void |
setValueExpression(java.lang.String name,
javax.el.ValueExpression binding)
Set the ValueExpression stored for the
specified name (if any), respecting any property
aliases. |
Methods inherited from class com.sun.webui.jsf.component.TextField |
---|
getAutoCompleteExpression, getNotify, getValueAsString, isAutoComplete, isAutoValidate, isSubmitForm, isSubmitFormSet, processUpdates, setAutoComplete, setAutoCompleteExpression, setAutoValidate, setNotify, setSubmitForm |
Methods inherited from class com.sun.webui.jsf.component.Field |
---|
getColumns, getFocusElementId, getIndicatorComponent, getLabel, getLabelComponent, getLabelLevel, getOnBlur, getOnChange, getOnClick, getOnDblClick, getOnFocus, getOnKeyDown, getOnKeyPress, getOnKeyUp, getOnMouseDown, getOnMouseMove, getOnMouseOut, getOnMouseOver, getOnMouseUp, getOnSelect, getPrimaryElementID, getReadOnlyComponent, getStyle, getStyleClass, getTabIndex, getToolTip, getValue, isDisabled, isReadOnly, isRequired, isVisible, setColumns, setDisabled, setLabel, setLabelLevel, setMaxLength, setOnBlur, setOnChange, setOnClick, setOnDblClick, setOnFocus, setOnKeyDown, setOnKeyPress, setOnKeyUp, setOnMouseDown, setOnMouseMove, setOnMouseOut, setOnMouseOver, setOnMouseUp, setOnSelect, setReadOnly, setStyle, setStyleClass, setTabIndex, setText, setToolTip, setTrim, setVisible |
Methods inherited from class com.sun.webui.jsf.component.HiddenField |
---|
getHtmlTemplate, setHtmlTemplate |
Methods inherited from class com.sun.webui.jsf.component.WebuiInput |
---|
broadcast, getValidator, getValidatorExpression, getValueChangeListener, getValueChangeListenerExpression, processDecodes, processValidators, setConverter, setId, setImmediate, setRendered, setValidatorExpression, setValueChangeListenerExpression |
Methods inherited from class javax.faces.component.UIInput |
---|
addValidator, addValueChangeListener, decode, getConverterMessage, getRequiredMessage, getSubmittedValue, getValidatorMessage, getValidators, getValueChangeListeners, isImmediate, isLocalValueSet, isValid, removeValidator, removeValueChangeListener, resetValue, setConverterMessage, setLocalValueSet, setRequiredMessage, setSubmittedValue, setValid, setValidator, setValidatorMessage, setValue, setValueChangeListener, updateModel, validate |
Methods inherited from class javax.faces.component.UIOutput |
---|
getLocalValue |
Methods inherited from class javax.faces.component.UIComponentBase |
---|
encodeBegin, encodeChildren, encodeEnd, findComponent, getAttributes, getChildCount, getChildren, getClientId, getFacet, getFacetCount, getFacets, getFacetsAndChildren, getId, getParent, getRendersChildren, getValueBinding, invokeOnComponent, isRendered, isTransient, processRestoreState, processSaveState, queueEvent, restoreAttachedState, saveAttachedState, setParent, setRendererType, setTransient, setValueBinding |
Methods inherited from class javax.faces.component.UIComponent |
---|
encodeAll, getContainerClientId |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface javax.faces.component.ValueHolder |
---|
getLocalValue |
Field Detail |
---|
public static final java.lang.String DATE_PICKER_LINK_FACET
public static final java.lang.String PATTERN_ID
public static final java.lang.String TEXT_FIELD_FACET
Constructor Detail |
---|
public Calendar()
Method Detail |
---|
public java.lang.String getFamily()
Return the family for this component.
getFamily
in class TextField
public java.lang.String getRendererType()
TextField
getRendererType
in class TextField
public ImageHyperlink getDatePickerLink(javax.faces.context.FacesContext context)
context
- The current FacesContext.
public com.sun.webui.jsf.component.CalendarMonth getDatePicker()
public java.lang.String getJavaScriptObjectName(javax.faces.context.FacesContext context)
public javax.faces.convert.Converter getConverter()
getConverter
in interface javax.faces.component.ValueHolder
getConverter
in class javax.faces.component.UIOutput
public java.lang.String getReadOnlyValueString(javax.faces.context.FacesContext context)
HiddenField
Return the value to be rendered as a string when the component is readOnly. The default behaviour is to invoke getValueAsString(). Override this method in case a component needs specialized behaviour.
getReadOnlyValueString
in class HiddenField
context
- FacesContext for the current request
public java.text.DateFormat getDateFormat()
getDateFormat
in interface DateManager
public java.util.Date getFirstAvailableDate()
getFirstAvailableDate
in interface DateManager
public java.util.Date getLastAvailableDate()
getLastAvailableDate
in interface DateManager
public java.lang.String getLabeledElementId(javax.faces.context.FacesContext context)
for
attribute.
If the ComplexComponent
has sub-compoents, and one of
the sub-components is the target of a label, if that sub-component
is a ComplexComponent
, then
getLabeledElementId
must called on the sub-component and
the value returned. The value returned by this
method call may or may not resolve to a component instance.
getLabeledElementId
in interface com.sun.webui.jsf.component.ComplexComponent
getLabeledElementId
in class Field
context
- The FacesContext used for the request
for
attribute.public void setDateFormatPattern(java.lang.String dateFormatPattern)
public void setTimeZone(java.util.TimeZone timeZone)
public void setRequired(boolean required)
setRequired
in interface javax.faces.component.EditableValueHolder
setRequired
in class WebuiInput
public int getMaxLength()
Field
The maximum number of characters that can be entered for this field.
getMaxLength
in class Field
public java.lang.Object getText()
Field
Literal value to be rendered in this input field. If this property is specified by a value binding expression, the corresponding value will be updated if validation succeeds.
getText
in class Field
public boolean isTrim()
Field
Flag indicating that any leading and trailing blanks will be trimmed prior to conversion to the destination data type. Default value is true.
isTrim
in class Field
public javax.el.ValueExpression getValueExpression(java.lang.String name)
Return the ValueExpression
stored for the
specified name (if any), respecting any property aliases.
getValueExpression
in class Field
name
- Name of value binding expression to retrievepublic void setValueExpression(java.lang.String name, javax.el.ValueExpression binding)
Set the ValueExpression
stored for the
specified name (if any), respecting any property
aliases.
setValueExpression
in class Field
name
- Name of value binding to setbinding
- ValueExpression to set, or null to removepublic java.lang.String getDateFormatPattern()
The date format pattern to use (i.e. yyyy-MM-dd). The
calendar component uses an instance of
java.text.SimpleDateFormat
and you can specify
a pattern to be used by this component with the following
restriction: the format pattern must include yyyy
(not
yy
), MM
, and dd
; and no
other time elements(such as seconds or minutes) may be displayed. If a pattern is not
specified, a locale-specific default is used.
If you change the date format pattern, you might also need to
change the dateFormatPatternHelp
attribute. See the
documentation for that attribute.
getDateFormatPattern
in interface DateManager
public java.lang.String getDateFormatPatternHelp()
A message located below the textfield for the date.Indicates which string format to use when entering a date as text into the textfield.
The calendar component internally relies on an instance of
java.text.SimpleDateFormat
to produce this help.
The default hint is constructed by invoking the
toLocalizedPattern()
method on the
SimpleDateFormat
instance and converting this
String to lower case.
Due to a bug in
SimpleDateFormat
,
toLocalizedPattern()
does not actually produce
locale-appropriate strings for most locales (it works for
German, but not for other locales). If the default value for
the dateFormtPattern
is used, the calendar
component performs the localization itself, but if the default
is overridden, you may need to override the hint on a
per-locale basis too.
public void setDateFormatPatternHelp(java.lang.String dateFormatPatternHelp)
A message located below the textfield for the date.Indicates which string format to use when entering a date as text into the textfield.
The calendar component internally relies on an instance of
java.text.SimpleDateFormat
to produce this help.
The default hint is constructed by invoking the
toLocalizedPattern()
method on the
SimpleDateFormat
instance and converting this
String to lower case.
Due to a bug in
SimpleDateFormat
,
toLocalizedPattern()
does not actually produce
locale-appropriate strings for most locales (it works for
German, but not for other locales). If the default value for
the dateFormtPattern
is used, the calendar
component performs the localization itself, but if the default
is overridden, you may need to override the hint on a
per-locale basis too.
getDateFormatPatternHelp()
public java.util.Date getMaxDate()
A java.util.Date
object representing the last
selectable day. The default value is 200 years after the
minDate
(which is evaluated first).
The value of this attribute is reflected in the years that are available for selection in the month display. In future releases of this component, web application users will also not be able to view months after this date, or select days that follow this date. At present such dates can be selected, but will not be validated when the form is submitted.
public void setMaxDate(java.util.Date maxDate)
A java.util.Date
object representing the last
selectable day. The default value is 200 years after the
minDate
(which is evaluated first).
The value of this attribute is reflected in the years that are available for selection in the month display. In future releases of this component, web application users will also not be able to view months after this date, or select days that follow this date. At present such dates can be selected, but will not be validated when the form is submitted.
getMaxDate()
public java.util.Date getMinDate()
A java.util.Date
object representing the first
selectable day. The default value is 100 years prior to today's date.
The value of this attribute is reflected in the years that are available for selection in the month display. In future releases of this component, web application users will not be able to view months before this date, or select days that precede this date. At present such dates can be selected, but are not validated when the form is submitted.
public void setMinDate(java.util.Date minDate)
A java.util.Date
object representing the first
selectable day. The default value is 100 years prior to today's date.
The value of this attribute is reflected in the years that are available for selection in the month display. In future releases of this component, web application users will not be able to view months before this date, or select days that precede this date. At present such dates can be selected, but are not validated when the form is submitted.
getMinDate()
public java.util.Date getSelectedDate()
A java.util.Date
object representing the currently
selected calendar date.
public void setSelectedDate(java.util.Date selectedDate)
A java.util.Date
object representing the currently
selected calendar date.
getSelectedDate()
public java.util.TimeZone getTimeZone()
The java.util.TimeZone
that is used with the calendar
component. Unless set, the default TimeZone for the locale in
javax.faces.component.UIViewRoot
is used.
getTimeZone
in interface DateManager
public void restoreState(javax.faces.context.FacesContext _context, java.lang.Object _state)
Restore the state of this component.
restoreState
in interface javax.faces.component.StateHolder
restoreState
in class TextField
public java.lang.Object saveState(javax.faces.context.FacesContext _context)
Save the state of this component.
saveState
in interface javax.faces.component.StateHolder
saveState
in class TextField
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |