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

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: 1327313 $ $Date: 2012-04-17 17:38:42 -0500 (Tue, 17 Apr 2012) $
Author:
Sylvain Vieujot (latest modification by $Author: lu4242 $)

Nested Class Summary
static class AbstractHtmlInputDate.UserData
           
 
Field Summary
static String COMPONENT_FAMILY
           
static String COMPONENT_TYPE
           
 
Fields inherited from class javax.faces.component.UIInput
CONVERSION_MESSAGE_ID, REQUIRED_MESSAGE_ID
 
Fields inherited from interface org.apache.myfaces.component.UserRoleAware
ENABLED_ON_USER_ROLE_ATTR, VISIBLE_ON_USER_ROLE_ATTR
 
Constructor Summary
AbstractHtmlInputDate()
           
 
Method Summary
 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  String getEmptyAmpmSelection()
          Label to be used when displaying an empty ampm selection
abstract  String getEmptyMonthSelection()
          Label to be used when displaying an empty month selection
abstract  String getTimeZone()
           
abstract  String getType()
          Specifies the type of value to be accepted.
 AbstractHtmlInputDate.UserData getUserData(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, getDir, 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, setDir, setDisabled, 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, getFamily, getSubmittedValue, getValidator, getValidators, getValue, getValueChangeListener, getValueChangeListeners, isImmediate, isLocalValueSet, isRequired, isValid, processDecodes, processUpdates, processValidators, removeValidator, removeValueChangeListener, setImmediate, setLocalValueSet, setRequired, setSubmittedValue, setValid, setValidator, 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, getFacets, getFacetsAndChildren, getId, getParent, getRenderer, getRendererType, getRendersChildren, getValueBinding, isTransient, processRestoreState, processSaveState, queueEvent, removeFacesListener, restoreAttachedState, saveAttachedState, setId, setParent, setRendered, setRendererType, setTransient, setValueBinding
 
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 String COMPONENT_TYPE
See Also:
Constant Field Values

COMPONENT_FAMILY

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

AbstractHtmlInputDate

public AbstractHtmlInputDate()
Method Detail

getClientId

public 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(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 String getTimeZone()

getType

public abstract 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 String getEmptyMonthSelection()
Label to be used when displaying an empty month selection


getEmptyAmpmSelection

public abstract 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 © 2012 The Apache Software Foundation. All Rights Reserved.