The Calendar Reusable Component

This Component enables you to easily add a calendar or date list of values to an application. The Calendar window will automatically display the calendar according to the NLS settings that are currently in effect, adjusting the start of the week (e.g., Sunday in the United States, Monday in Western Europe) and the month and day names accordingly. The Component contains the following Form Builder objects:

Creating a Calendar

To create a calendar:

  1. From the Components page of the reusable_components.olb object library, copy or subclass the Calendar object group.
  2. Attach the PL/SQL library calendar90.pll, which contains the Date_LOV package, to your module.
  3. Create a Key-Listval trigger on the date item for which you would like to use the Date List of Values window. Add code to display the calendar using the Date_LOV package.
  4. If you want the end user to be able to close the Date List of Values window by clicking on the window close button in the title bar, create a form level When-Window-Closed trigger 

The calendar will appear whenever the end user invokes a list of values for the date item. A single calendar can be re-used on many different date items. Simply create a Key-Listval trigger for each item.

Calendar Class Routines

Date_LOV.Get_Date 

Description 

Displays calendar with the month and year specified in the Display_Date argument. The day of the month is displayed with bold numbers. The date chosen by the end user is returned to the item specified by the Return_Item argument.

Syntax

PROCEDURE Date_LOV.Get_Date(display_date DATE, 
                            return_item  VARCHAR2,
window_x_pos NUMBER := 0,
window_y_pos NUMBER := 0,
window_title VARCHAR2 := 'Date List of Values',
ok_label VARCHAR2 := 'OK',
cancel_label VARCHAR2 := 'Cancel',
highlight BOOLEAN := TRUE,
autoconfirm BOOLEAN := TRUE,
autoskip BOOLEAN := FALSE);

Parameters

display_date   The date to display when the Date List of Values window first appears.
return_item   The name of the block and item to return the chosen date to.
window_x_pos   Specifies the X coordinate of the Date List of Values window.
window_y_pos   Specifies the Y coordinate of the Date List of Values window.
window_title   Title to display in the Date List of Values window.
ok_label   Label for the OK button.
cancel_label   Label for the Cancel button.
highlight   Specifies that weekend days will appear in a different color.
autoconfirm   Specifies that the date will immediately be returned t when the end user clicks a day.
autoskip   Specifies that the input focus moves to the next item in sequence.