PAJES 2.3.9

org.pajes.html
Class InputDate

java.lang.Object
  extended byorg.pajes.html.Tag
      extended byorg.pajes.html.Input
          extended byorg.pajes.html.InputField
              extended byorg.pajes.html.InputString
                  extended byorg.pajes.html.InputDateTimeString
                      extended byorg.pajes.html.InputDate
All Implemented Interfaces:
java.lang.Cloneable, HTML, InputMandatoryValidation, InputValidation, java.io.Serializable

public class InputDate
extends InputDateTimeString

This class creates an input field in a form that accepts a date value from the user. The default date time format expected is "yyyy-MM-dd".

By default, the input field is also followed by an icon, which when clicked, produces a pop-up calendar for the user to select a date.

See Also:
Serialized Form

Nested Class Summary
 class InputDate.Window
          Represents the dimensions and location of the pop-up calendar window.
 
Field Summary
 
Fields inherited from class org.pajes.html.Input
TYPE_ATTRIBUTE
 
Fields inherited from class org.pajes.html.Tag
ON_CLICK_ATTRIBUTE, TAG_CLOSE, TAG_LEFT, TAG_RIGHT
 
Constructor Summary
InputDate(Form form, java.lang.String name)
          Creates a named input field.
InputDate(Form form, java.lang.String name, java.sql.Date value)
          Creates a named input field with a default value.
InputDate(Form form, java.lang.String name, java.lang.String value)
          Creates a named input field with a default value.
InputDate(InputField source)
          Creates a named input field.
 
Method Summary
 InputDate.Window getPopUpCalendarWindow()
          Returns the Window object representing the dimensions and location of the pop-up calendar window.
 InputDate setPopUpCalendar(boolean display)
          Determines whether or not the pop-up calendar icon will be displayed.
 InputDate setPopUpCalendarImageTitle(java.lang.String title)
          Sets the title displayed when the mouse cursor traverses the pop-up calendar icon.
 InputDate setPopUpCalendarImageURL(java.lang.String url)
          Sets the URL of the image to be used as the pop-up calendar icon.
 InputDate setPopUpCalendarStyleSheetURL(java.lang.String url)
          Sets the URL of the style sheet to be used for the pop-up calendar.
 InputDate setPopUpCalendarWindow(int h, int w, int x, int y)
          Sets the dimensions and location of the pop-up calendar window.
 InputDate setPopUpCalendarYearRange(int from, int to)
          Sets the year range to be displayed in the drop down navigation list.
 void write(Browser browser)
          Writes the <input> date field tag to the browser.
 
Methods inherited from class org.pajes.html.InputDateTimeString
getDateValue, getFormat, setFormat, setValue, setValue
 
Methods inherited from class org.pajes.html.InputField
getClientValidation, getMaxLength, getSize, isMandatory, setMandatory, setMandatory, setMandatory, setMaxLength, setMaxLength, setSize, setSize
 
Methods inherited from class org.pajes.html.Input
addClientValidation, addContent, clone, getClientValidation, getDOMReference, getFieldNameForErrorMessage, getForm, getInstance, getLabel, getName, getOnBlurHandler, getOnChangeHandler, getOnFocusHandler, getOnSelectHandler, getReadOnlyStyleSheetClass, getTabIndex, getType, getValue, isChangeFlagEnabled, isDisabled, isReadOnly, isRequiringValidation, logNoFormWarning, removeClientValidation, removeClientValidation, removeClientValidation, removeMandatoryClientValidation, setChanged, setChangedFlag, setContent, setDisabled, setFieldNameInErrorMessage, setFieldNameInErrorMessage, setForm, setId, setLabel, setName, setOnBlurHandler, setOnBlurValidation, setOnChangeHandler, setOnClickHandler, setOnFocusHandler, setOnSelectHandler, setReadOnly, setReadOnlyStyleSheetClass, setTabIndex, setTabIndex, setTabIndex
 
Methods inherited from class org.pajes.html.Tag
addAttribute, addAttributes, addAttributes, clearAttribute, clearAttributes, destroy, getAttribute, getAttributes, getAttributeSet, getContainer, getContent, getDocument, getId, getOnClickHandler, getOnDBLClickHandler, getOnKeyDownHandler, getOnKeyPressHandler, getOnKeyUpHandler, getOnMouseDownHandler, getOnMouseOutHandler, getOnMouseOverHandler, getOnMouseUpHandler, getStyle, getStyleSheetClass, getTagName, getTitle, getWritePermission, init, initAttributes, isWritable, isWritable, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttributes, setAttributes, setContainer, setContent, setOnDBLClickHandler, setOnKeyDownHandler, setOnKeyPressHandler, setOnKeyUpHandler, setOnMouseDownHandler, setOnMouseOutHandler, setOnMouseOverHandler, setOnMouseUpHandler, setStyle, setStyleSheetClass, setTagName, setTitle, setWritable, setWriteAttributes, setWriteEndTag, setWritelnAfter, setWritelnAfterContent, setWritelnBefore, setWritelnBeforeContent, setWritePermission, toString, writeContent
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.pajes.html.InputValidation
getDOMReference, getName, isRequiringValidation, setOnBlurValidation
 

Constructor Detail

InputDate

public InputDate(InputField source)
Creates a named input field.

Parameters:
source - the input field from which this input field will be created.

InputDate

public InputDate(Form form,
                 java.lang.String name)
Creates a named input field.

Parameters:
form - the form on which this input field will appear. Note that the element must still be added to the form - this reference is used by the getDOMReference() method to determine the fully qualified element name.
name - the name to apply to the input object, so that it may be manipulated using client-side JavaScript.

InputDate

public InputDate(Form form,
                 java.lang.String name,
                 java.sql.Date value)
Creates a named input field with a default value.

Parameters:
form - the form on which this input field will appear. Note that the element must still be added to the form - this reference is used by the getDOMReference() method to determine the fully qualified element name.
name - the name to apply to the input object, so that it may be manipulated using client-side JavaScript.
value - the default value to assign to the field.

InputDate

public InputDate(Form form,
                 java.lang.String name,
                 java.lang.String value)
Creates a named input field with a default value.

Parameters:
form - the form on which this input field will appear. Note that the element must still be added to the form - this reference is used by the getDOMReference() method to determine the fully qualified element name.
name - the name to apply to the input object, so that it may be manipulated using client-side JavaScript.
value - the default value to assign.
Method Detail

setPopUpCalendar

public InputDate setPopUpCalendar(boolean display)
Determines whether or not the pop-up calendar icon will be displayed.

By default, the pop-up calendar is enabled. To disable it as the default, the web application deployment descriptor must have a <context-param> with a <param-name> of org.pajes.html.InputDate.popUpCalendar , and a <param-value> of false. For example:

   <context-param>
       <param-name>org.pajes.html.InputDate.popUpCalendar</param-name>
       <param-value>false</param-value>
   </context-param>
 

Parameters:
display - if false, the icon will not be displayed.
Returns:
the modified InputDate object.

setPopUpCalendarImageTitle

public InputDate setPopUpCalendarImageTitle(java.lang.String title)
Sets the title displayed when the mouse cursor traverses the pop-up calendar icon.

The default title can be set in the web application deployment descriptor with a <context-param> with a <param-name> of org.pajes.html.InputDate.popUpCalendarIconTitle, and a <param-value> with the text to be displayed. For example:

   <context-param>
       <param-name>org.pajes.html.InputDate.popUpCalendarIconTitle</param-name>
       <param-value>Click here to pick a date!</param-value>
   </context-param>
 

Parameters:
title - the title displayed when the mouse cursor traverses the pop-up calendar icon.
Returns:
the modified InputDate object.
See Also:
setPopUpCalendarImageURL(java.lang.String)

setPopUpCalendarImageURL

public InputDate setPopUpCalendarImageURL(java.lang.String url)
Sets the URL of the image to be used as the pop-up calendar icon.

The default icon can be set in the web application deployment descriptor with a <context-param> with a <param-name> of org.pajes.html.InputDate.popUpCalendarIcon, and a <param-value> with the URL of the icon. For example:

   <context-param>
       <param-name>org.pajes.html.InputDate.popUpCalendarIcon</param-name>
       <param-value>images/calendar.gif</param-value>
   </context-param>
 

Parameters:
url - the URL of the image to be used as the pop-up calendar icon.
Returns:
the modified InputDate object.
See Also:
setPopUpCalendarImageTitle(java.lang.String)

setPopUpCalendarStyleSheetURL

public InputDate setPopUpCalendarStyleSheetURL(java.lang.String url)
Sets the URL of the style sheet to be used for the pop-up calendar.

The default style sheet can be set in the web application deployment descriptor with a <context-param> with a <param-name> of org.pajes.html.InputDate.popUpCalendarStyleSheet, and a <param-value> with the URL of the style sheet you wish to use. For example:

   <context-param>
       <param-name>org.pajes.html.InputDate.popUpCalendarStyleSheet</param-name>
       <param-value>css/calendar.css</param-value>
   </context-param>
 

Parameters:
url - the URL of the style sheet to be used as the pop-up calendar.
Returns:
the modified InputDate object.

setPopUpCalendarWindow

public InputDate setPopUpCalendarWindow(int h,
                                        int w,
                                        int x,
                                        int y)
Sets the dimensions and location of the pop-up calendar window.

Parameters:
h - the window height.
w - the window width.
x - the offset from the top of the screen.
y - the offset from the left of the screen.
Returns:
the modified InputDate object.

getPopUpCalendarWindow

public InputDate.Window getPopUpCalendarWindow()
Returns the Window object representing the dimensions and location of the pop-up calendar window.

Returns:
the Window object.

setPopUpCalendarYearRange

public InputDate setPopUpCalendarYearRange(int from,
                                           int to)
Sets the year range to be displayed in the drop down navigation list. If not specified, the default is two years back from today and nine years forward.

Parameters:
from - the first year to be displayed in the drop down navigation list of the pop-up calendar window.
to - the last year to be displayed in the drop down navigation list of the pop-up calendar window.
Returns:
the modified InputDate object.

write

public void write(Browser browser)
           throws java.io.IOException
Writes the <input> date field tag to the browser.

Specified by:
write in interface HTML
Overrides:
write in class Input
Parameters:
browser - the browser to which the results are to be output.
Throws:
java.io.IOException - if an I/O error occurs writing to the browser.

PAJES 2.3.9

Copyright © 2002-2003 Viridian Pty Limited. All Rights Reserved.