FileDocCategorySizeDatePackage
InputDatePickerTag.javaAPI DocExample3444Tue Jun 08 11:26:42 BST 2004com.mycompany.jsf.taglib

InputDatePickerTag

public class InputDatePickerTag extends javax.faces.webapp.UIComponentTag
This class is a tag handler that creates and configures a "javax.faces.Input" component with a "com.mycompany.DatePicker" renderer.
author
Hans Bergsten, Gefion Software
version
1.0

Fields Summary
private String
startYear
private String
years
private String
value
private String
styleClass
Constructors Summary
Methods Summary
public java.lang.StringgetComponentType()
Returns "javax.faces.Input".

	return "javax.faces.Input";
    
public java.lang.StringgetRendererType()
Returns "com.mycompany.DatePicker".

	return "com.mycompany.DatePicker";
    
protected voidsetProperties(javax.faces.component.UIComponent component)
Configures the component based on the tag handler property values.

        super.setProperties(component);

	FacesContext context = getFacesContext();
        if (startYear != null) {
            if (isValueReference(startYear)) {
                ValueBinding vb = 
		    context.getApplication().createValueBinding(startYear);
                component.setValueBinding("startYear", vb);
            } else {
                component.getAttributes().put("startYear", 
		    new Integer(startYear));
            }
        }

        if (years != null) {
            if (isValueReference(years)) {
                ValueBinding vb = 
		    context.getApplication().createValueBinding(years);
                component.setValueBinding("years", vb);
            } else {
                component.getAttributes().put("years", new Integer(years));
            }
        }

        if (value != null) {
            if (isValueReference(value)) {
		ValueBinding vb = 
		    context.getApplication().createValueBinding(value);
		component.setValueBinding("value", vb);
            } else {
                component.getAttributes().put("value", value);
            }
        }
                
        if (styleClass != null) {
            if (isValueReference(styleClass)) {
                ValueBinding vb = 
		    context.getApplication().createValueBinding(styleClass);
                component.setValueBinding("styleClass", vb);
            } else {
                component.getAttributes().put("styleClass", styleClass);
            }
        }
    
public voidsetStartYear(java.lang.String startYear)
Sets the first year to include in the year selection list. The default is two years prior to the current year.

        this.startYear = startYear;
    
public voidsetStyleClass(java.lang.String styleClass)
Sets the CSS class for the rendered "select" elements.

        this.styleClass = styleClass;
    
public voidsetValue(java.lang.String value)
Sets the component's value. This must be a JSF value binding expression for a "java.util.Date" instance.

        this.value = value;
    
public voidsetYears(java.lang.String years)
Set the number of years to include in the year selection list. The default is five years.

        this.years = years;