WebObjects/Web Applications/Development/Examples/Calendar Component

Here is a little example on how to write a "calendar" component:

So you have a specific month, some of the dates are links (that will depend on what the calendar is for) and some basics navigations (next/previous month, year).

That's how the html could look like:

              <webobject name = "HasNavigation"> <td align = "left" valign = "top" colspan ="3"> <webobject name = "HasPreviousMonth"> <webobject name = "PreviousMonthLink"><webobject name = "PreviousMonth"> <td align = "left" valign = "top"> <td align = "right" valign = "top" colspan ="3"> <webobject name = "HasNextMonth"> <webobject name = "NextMonthLink"><webobject name = "NextMonth">

And here is the wod:

Table: WOGenericContainer{ elementName = "table"; border = "0"; cellSpacing = "0"; cellPadding = "0"; }; HasNavigation: WOConditional {   condition = hasNavigation; }; YearLink: WOHyperlink{ action = displayYear; }; Year: SpanString{ value = month.year; isBold = true; isSmall = true; class = "Label"; }; Rows: WORepetition{ count = rowCount; index = rowIndex; }; Columns: WORepetition{ count = columnCount; index = columnIndex; }; Month: SpanString{ value = month.monthName.toUpperCase; isBold = true; isSmall = true; class = "Label"; }; DayName: SpanString{ value = dayName; isSmall = true; class = "Label"; }; HasLink: WOConditional{ condition = hasLink; }; HasNoLink: WOConditional{ condition = hasLink; negate = true; }; IsCurrentDay: WOConditional{ condition = isCurrentDay; }; Link: WOHyperlink{ action = displayDay; }; Day: SpanString{ value = day.day; isSmall = true; isBold = isCurrentDay; isItalic = isCurrentDay; class = "Label"; }; HasNextMonth: WOConditional{ condition = hasNextMonth; }; NextMonthLink: WOHyperlink{ action = displayNextMonth; }; NextMonth: SpanString {   value = nextMonthName; isSmall = true; class = "Label"; }; HasPreviousMonth: WOConditional{ condition = hasPreviousMonth; }; PreviousMonthLink: WOHyperlink{ action = displayPreviousMonth; }; PreviousMonth: SpanString{ value = previousMonthName; isSmall = true; class = "Label"; };

The component implementation is left to the imagination