LSPS documentation logo
LSPS Documentation
Calendar

The Calendar ( ) component is rendered as a calendar with calendar entries. The calendar entries are clickable and can be dragged-and-dropped. You can also select the calendar mode in the calendar. These actions fire the respective events.

It produces events of the following types:

  • InitEvent when the component is initialized or displayed if previously hidden
  • CalendarEditEvent when the user clicks a calendar entry
  • CalendarRescheduleEvent when the user drags a calendar entry
  • CalendarCreateEvent when the user selects a time period by clicking and dragging

The calendar component is displayed in month mode by default. To display a day schedule, click the day date in the calendar cell. Note that if a calendar entry needs to be scheduled in the day mode and keep track of exact hours, the allDay property of the entry must be set to false.

  • Data: closure that returns a set of business data for the calendar (the data contains information about individual calendar entries)
    {
        x, y -> def Set<Object> result:={};
        foreach Note n in notes do
            if n.notetype == NoteType.MEETING
            then
              result:=add(result, n)
             end;
        end;
        result
    }
    
  • To item: closure that transforms the data from the set defined in the Data property to CalendarItem
    { mynote:Note -> new ui::CalendarItem(
                    caption -> mynote.description,
                    description -> "Imported MEETING note",
                    from -> mynote.time.from,
                    to -> mynote.time.to,
                    allDay -> false,
                    style -> null)}
    
  • Initial Date: date that is selected in the calendar when first opened (By default, the current date is selected.)
  • Mode: calendar display mode

    The property determines the way a calendar is displayed initially and after refresh. The possible values are daily, weekly, monthly.

  • Read only: calendar renders as read-only and cannot be edited

    If read-only, CalendarRescheduleEvent, CalendarCreateEvent are not fired. CalendarEditEvent is fired to allow the form to display an event details.