|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjavax.faces.render.Renderer
com.mycompany.jsf.renderer.DatePickerRenderer
This class is a JSF Renderer for the "javax.faces.Input" component type. It renders a date value as three selection lists for the year, month and day.
Constructor Summary | |
DatePickerRenderer()
|
Method Summary | |
void |
decode(javax.faces.context.FacesContext context,
javax.faces.component.UIComponent component)
Creates a Map to hold the year, month and day values from the request parameters and saves it as the submitted value for the component. |
void |
encodeBegin(javax.faces.context.FacesContext context,
javax.faces.component.UIComponent component)
Renders selection lists for the year, month and day value. |
java.lang.Object |
getConvertedValue(javax.faces.context.FacesContext context,
javax.faces.component.UIComponent component,
java.lang.Object submittedValue)
Returns a Date instance created from the year, month and day values held by the Map submitted value. |
private java.util.List |
getDays()
Returns a List with SelectItem instances representing 31 days. |
private java.util.List |
getMonths()
Returns a List with SelectItem instances representing all months. |
private java.util.List |
getYears(int startYear,
int noOfyears)
Returns a List with SelectItem instances representing the specified number of years, starting with the specified start year. |
private boolean |
isDisabledOrReadOnly(javax.faces.component.UIComponent component)
Returns true if one or both of the HTML attributes "disabled" or "readonly" are set to true. |
private void |
renderMenu(javax.faces.context.ResponseWriter out,
java.util.List items,
int selected,
java.lang.String clientId,
java.lang.String styleClass,
javax.faces.component.UIComponent component)
Writes a "select" element with "option" elements based on the List with SelectItem instances, with a "selected" attribute for the SelectItem matching the selected value. |
Methods inherited from class javax.faces.render.Renderer |
convertClientId, encodeChildren, encodeEnd, getRendersChildren |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public DatePickerRenderer()
Method Detail |
public void decode(javax.faces.context.FacesContext context, javax.faces.component.UIComponent component)
public java.lang.Object getConvertedValue(javax.faces.context.FacesContext context, javax.faces.component.UIComponent component, java.lang.Object submittedValue)
public void encodeBegin(javax.faces.context.FacesContext context, javax.faces.component.UIComponent component) throws java.io.IOException
java.io.IOException
private java.util.List getYears(int startYear, int noOfyears)
private java.util.List getMonths()
private java.util.List getDays()
private void renderMenu(javax.faces.context.ResponseWriter out, java.util.List items, int selected, java.lang.String clientId, java.lang.String styleClass, javax.faces.component.UIComponent component) throws java.io.IOException
java.io.IOException
private boolean isDisabledOrReadOnly(javax.faces.component.UIComponent component)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |