Calendar Classes Creating the Calendar

Creating a Calendar Application 15-7 – wed – thu – fri – sat ■ StartHour : Enter a number that represents the hour in 24 hour format, with 0 being midnight that should be displayed at the top of the day and week view. While the calendar when in day or week view starts the day at 12:01 a.m., the calendar will automatically scroll to the startHour value, so that it is displayed at the top of the view. The user can always scroll above that time to view activities that start before the startHour value. ■ ListType : Select how you want the list view to display activities. Valid values are: – day: Shows activities only for the active day. – dayCount: Shows a number of days including the active day and after, based on the value of the listCount attribute. – month: Shows all the activities for the month to which the active day belongs. – week: Shows all the activities for the week to which the active day belongs ■ ListCount : Enter the number of days’ activities to display used only when the listType attribute is set to dayCount. Figure 15–5 shows a calendar in list view with the listType set to dayCount and the listCount value set to 7. Figure 15–5 LIst View Using dayCount Type

2. Expand the Calendar Data section of the Property Inspector, and set the following:

■ ActiveDay : Set the day used to determine the date range that is displayed in the calendar. By default, the active day is today’s date for the user. Do not change this if you want today’s date to be the default active day when the calendar is first opened. Note that when the user selects another day, this becomes the value for the activeDay attribute. For example, when the user first accesses the calendar, the current date, February 6, 2009 is the active day. The month view will show February. If the user uses the next button to scroll to the next month, the active date will become March 6, 2009. ■ TimeZone : Set the time zone for the calendar. If not set, the value is taken from AdfFacesContext. The valid value is a java.util.TimeZone object.

3. Expand the Other section of the Property Inspector and set AvailableViews. The

value can be one of or a combination of the following: ■ month ■ week 15-8 Web User Interface Developers Guide for Oracle Application Development Framework ■ day ■ list ■ all If you want to enter more than one value, enter the values with a space between. For example, if you want the calendar to use day and week views, you would enter the following: day week The corresponding buttons will automatically be displayed in the toolbar, in the order they appear in the list. If you do not enter day as an available view, then activities will be listed as plain text rather than as links in the list and week views provided you do not also enter all. 4. If you want the user to be able to drag a handle on an existing activity to expand or collapse the time period of the activity, then implement a handler for CalendarActivityDurationChangeListener. This handler should include functionality that changes the end time of the activity. If you want the user to be able to move the activity and, therefore, change the start time as well as the end time, then implement drag and drop functionality. For more information, see Section 32.7, Adding Drag and Drop Functionality to a Calendar. You can now add the following functionality: ■ Allow users to create, edit, and delete activities using popup components. For more information, see Section 15.4, Adding Functionality Using Popup Components. ■ Allow users to move activities around on the calendar. For more information, see Section 32.7, Adding Drag and Drop Functionality to a Calendar. ■ Change or add to the toolbar buttons in the toolbar. For more information, see Section 15.5, Customizing the Toolbar. ■ Change the appearance of the calendar and events. For more information, see Section 15.6, Styling the Calendar.

15.3.2 What Happens at Runtime: Calendar Events and PPR

The calendar has two events that are used in conjunction with facets to provide a way to easily implement additional functionality needed in a calendar, such as editing or adding activities. These two events are CalendarActivityEvent invoked when an action occurs on an activity and CalendarEvent invoked when an action occurs on the calendar, itself. For more information about using these events to provide Note: If all is entered, then all views are available, regardless if one is left out of the list. Note: In order to handle an overflow of tasks for a given day in the month view, if you enter month and do not also enter all, then you must also enter day.