This is an example from the standard WebObjects distribution. It has been coverted to WOPerl.


TimeOff

The TimeOff application lets a user submit a vacation request. This request consists of a vacation start date, an end date, and the user's login and password.

TimeOff includes a reusable component, Calendar. The first page of the application displays two calendars: a Start Date calendar and an End Date calendar. Users select days in each calendar by clicking on them, and these selections are then submitted for processing.

The Calendar child component messages the parent component (Main) using a WOAction object. For another, much simpler example of an application that uses a child component, see Component.


Notable TimeOff Components

Main
The Main.wos script processes the information the user enters into the Calendar and text fields: the vacation start and end dates, a login, and the password. If any of these items is missing or if the information is logically inconsistent (for example, if the vacation end date precedes the vacation start date), this script returns an Error page stating the error.
Calendar
Calendar is a child component that's nested in the component associated with the page Main. It messages the parent component Main using a WOAction object callBack.

Interesting Issues From TimeOff

Creating a Reusable Component

TimeOff includes a reusable component, Calendar.

Sending callback messages from a child component to a parent

TimeOff provides an example of messaging a parent from a child component. This requires coordination between the parent's script and declarations file and the child's script. For a more detailed explanation of how it works in TimeOff, see the comments in the files Main.wos and Calendar.wos.