org.apache.myfaces.custom.date
Class AbstractHtmlInputDate

java.lang.Object
  extended by javax.faces.component.UIComponent
      extended by javax.faces.component.UIComponentBase
          extended by javax.faces.component.UIOutput
              extended by javax.faces.component.UIInput
                  extended by javax.faces.component.html.HtmlInputText
                      extended by org.apache.myfaces.custom.date.AbstractHtmlInputDate
All Implemented Interfaces:
javax.faces.component.EditableValueHolder, javax.faces.component.StateHolder, javax.faces.component.ValueHolder, AlignProperty, ForceIdAware, UserRoleAware
Direct Known Subclasses:
HtmlInputDate

public abstract class AbstractHtmlInputDate
extends javax.faces.component.html.HtmlInputText
implements UserRoleAware, ForceIdAware, AlignProperty

Custom input control for dates and times. Unless otherwise specified, all attributes accept static values or EL expressions.

Since:
1.1.7
Version:
$Revision: 990311 $ $Date: 2010-08-27 21:04:55 -0500 (Fri, 27 Aug 2010) $
Author:
Sylvain Vieujot (latest modification by $Author: lu4242 $)

Nested Class Summary
static class AbstractHtmlInputDate.UserData
           
 
Field Summary
static java.lang.String COMPONENT_FAMILY
           
static java.lang.String COMPONENT_TYPE
           
 
Fields inherited from class javax.faces.component.UIInput
CONVERSION_MESSAGE_ID, REQUIRED_MESSAGE_ID, UPDATE_MESSAGE_ID
 
Fields inherited from class javax.faces.component.UIComponent
bindings
 
Fields inherited from interface org.apache.myfaces.component.UserRoleAware
ENABLED_ON_USER_ROLE_ATTR, VISIBLE_ON_USER_ROLE_ATTR
 
Constructor Summary
AbstractHtmlInputDate()
           
 
Method Summary
 java.lang.String getClientId(javax.faces.context.FacesContext context)
          Overriden to support the force id, since the parent is not an extended component
 javax.faces.convert.Converter getConverter()
          Retrieve the converter used by this component.
abstract  DateBusinessConverter getDateBusinessConverter()
          Indicate an object used as a bridge between the java.util.Date instance used by this component internally and the value object used on the bean, referred as a "business" value.
abstract  java.lang.String getEmptyAmpmSelection()
          Label to be used when displaying an empty ampm selection
abstract  java.lang.String getEmptyMonthSelection()
          Label to be used when displaying an empty month selection
abstract  java.lang.String getTimeZone()
           
abstract  java.lang.String getType()
          Specifies the type of value to be accepted.
 AbstractHtmlInputDate.UserData getUserData(java.util.Locale currentLocale)
           
abstract  boolean isAmpm()
          If true, use 12hr times with AM/PM selector; if false, use 24hr time.
abstract  boolean isDisabled()
          HTML: When true, this element cannot receive focus.
abstract  boolean isPopupCalendar()
           
abstract  boolean isReadonly()
          HTML: When true, indicates that this component cannot be modified by the user.
 boolean isRendered()
           
abstract  void setDateBusinessConverter(DateBusinessConverter dateBusinessConverter)
           
 
Methods inherited from class javax.faces.component.html.HtmlInputText
getAccesskey, getAlt, getAutocomplete, getDir, getFamily, getLabel, getLang, getMaxlength, getOnblur, getOnchange, getOnclick, getOndblclick, getOnfocus, getOnkeydown, getOnkeypress, getOnkeyup, getOnmousedown, getOnmousemove, getOnmouseout, getOnmouseover, getOnmouseup, getOnselect, getSize, getStyle, getStyleClass, getTabindex, getTitle, restoreState, saveState, setAccesskey, setAlt, setAutocomplete, setDir, setDisabled, setLabel, setLang, setMaxlength, setOnblur, setOnchange, setOnclick, setOndblclick, setOnfocus, setOnkeydown, setOnkeypress, setOnkeyup, setOnmousedown, setOnmousemove, setOnmouseout, setOnmouseover, setOnmouseup, setOnselect, setReadonly, setSize, setStyle, setStyleClass, setTabindex, setTitle
 
Methods inherited from class javax.faces.component.UIInput
addValidator, addValueChangeListener, broadcast, compareValues, decode, getConvertedValue, getConverterMessage, getRequiredMessage, getSubmittedValue, getValidator, getValidatorMessage, getValidators, getValue, getValueChangeListener, getValueChangeListeners, isImmediate, isLocalValueSet, isRequired, isValid, processDecodes, processUpdates, processValidators, removeValidator, removeValueChangeListener, resetValue, setConverterMessage, setImmediate, setLocalValueSet, setRequired, setRequiredMessage, setSubmittedValue, setValid, setValidator, setValidatorMessage, setValue, setValueChangeListener, updateModel, validate, validateValue
 
Methods inherited from class javax.faces.component.UIOutput
getLocalValue, setConverter
 
Methods inherited from class javax.faces.component.UIComponentBase
addFacesListener, encodeBegin, encodeChildren, encodeEnd, findComponent, getAttributes, getChildCount, getChildren, getFacesContext, getFacesListeners, getFacet, getFacetCount, getFacets, getFacetsAndChildren, getId, getParent, getRenderer, getRendererType, getRendersChildren, getValueBinding, invokeOnComponent, isTransient, processRestoreState, processSaveState, queueEvent, removeFacesListener, restoreAttachedState, saveAttachedState, setId, setParent, setRendered, setRendererType, setTransient, setValueBinding
 
Methods inherited from class javax.faces.component.UIComponent
encodeAll, getContainerClientId, getValueExpression, setValueExpression
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.apache.myfaces.component.UserRoleAware
getEnabledOnUserRole, getVisibleOnUserRole, setEnabledOnUserRole, setVisibleOnUserRole
 
Methods inherited from interface org.apache.myfaces.component.ForceIdAware
isForceId, isForceIdIndex, setForceId, setForceIdIndex
 
Methods inherited from interface org.apache.myfaces.component.AlignProperty
getAlign
 
Methods inherited from interface javax.faces.component.ValueHolder
getLocalValue, setConverter
 

Field Detail

COMPONENT_TYPE

public static final java.lang.String COMPONENT_TYPE
See Also:
Constant Field Values

COMPONENT_FAMILY

public static final java.lang.String COMPONENT_FAMILY
See Also:
Constant Field Values
Constructor Detail

AbstractHtmlInputDate

public AbstractHtmlInputDate()
Method Detail

getClientId

public java.lang.String getClientId(javax.faces.context.FacesContext context)
Overriden to support the force id, since the parent is not an extended component

Overrides:
getClientId in class javax.faces.component.UIComponentBase

isRendered

public boolean isRendered()
Overrides:
isRendered in class javax.faces.component.UIComponentBase

getUserData

public AbstractHtmlInputDate.UserData getUserData(java.util.Locale currentLocale)

getDateBusinessConverter

public abstract DateBusinessConverter getDateBusinessConverter()
Indicate an object used as a bridge between the java.util.Date instance used by this component internally and the value object used on the bean, referred as a "business" value.


setDateBusinessConverter

public abstract void setDateBusinessConverter(DateBusinessConverter dateBusinessConverter)

getTimeZone

public abstract java.lang.String getTimeZone()

getType

public abstract java.lang.String getType()
Specifies the type of value to be accepted. Valid values are: date | time | short_time | both | full


isAmpm

public abstract boolean isAmpm()
If true, use 12hr times with AM/PM selector; if false, use 24hr time. Default false.


isPopupCalendar

public abstract boolean isPopupCalendar()

getEmptyMonthSelection

public abstract java.lang.String getEmptyMonthSelection()
Label to be used when displaying an empty month selection


getEmptyAmpmSelection

public abstract java.lang.String getEmptyAmpmSelection()
Label to be used when displaying an empty ampm selection


isReadonly

public abstract boolean isReadonly()
HTML: When true, indicates that this component cannot be modified by the user. The element may receive focus unless it has also been disabled.

Overrides:
isReadonly in class javax.faces.component.html.HtmlInputText

isDisabled

public abstract boolean isDisabled()
HTML: When true, this element cannot receive focus.

Overrides:
isDisabled in class javax.faces.component.html.HtmlInputText

getConverter

public javax.faces.convert.Converter getConverter()
Retrieve the converter used by this component.

If no converter is selected, submitted values are converted to its inner class UserData on decode method.

If some converter is used, submitted values are decoded as a String with the following format:

year=yyyy

month=mm

day=dd

hours=hh

minutes=mm

seconds=ss

ampm=ampm

Note that submitted values could be wrong and it is necessary to restore values on render response phase. The converter receive a string with this format on getAsObject method and it is expected the converter encode it on getAsString method, so the renderer can restore the submitted values correctly.

Specified by:
getConverter in interface javax.faces.component.ValueHolder
Overrides:
getConverter in class javax.faces.component.UIOutput


Copyright © 2011 The Apache Software Foundation. All Rights Reserved.