Calendar view nodes can be used to include a calendar component in the UI and use it to show and edit data. A calendar view shows the information for one or more calendars, that in turn contain zero or more items that are defined by an id, a description, and a pair of start/end dates.
The calendar's UI contains the following components:
- The calendar itself: the component can show a day, week, or month and the items contained in them.
- A header: the header does not display data. Instead, it provides several options that allow the user to navigate the calendar and determine what data should be shown in the main component. These subcomponents (listed in the same order that tehy appear in the UI) are:
- Calendar navigation: The user can choose to navigate to the current date of to a manually specified date using the component on the top left.
- Previous / Next period navigation: The user can go to the previous/next period using the arrows shown in the header.
- Month name: The name of the month being shown, to provide context.
- Calendar selection: When multiple calendars are provided, this control can be used to select which are shown.
- View selection: can be used to select which view (day/week/month) should be used in the main view.
|Calendar view components
The data shown in the component is determined by the calendar nodes contained in this node.
||The components's control name. Must be unique within the web panel.
||Determines if the header should be shown.
|Show Calendar Navigation
||Determines if the calendar navigation component should be shown.
|Show Period Navigation
||Determines if the previous / next period buttons shown be shown in the UI.
|Show Calendar Selection
||Determines if the user can choose which calendars should be shown in the UI.
|Show View Selection
||Determines if the user can change the view (day/week/month) using a combobox in the UI.
||The first hour that should be shown in the day and week views.
||The last hour that should be shown in the day and week views.
|Items Per Day In Month View
||Determines the maximum amount of items that are shown in each day in the month view.
||Determines if this control should allow the user to add new items or not.
||Day View Enabled
||Determines if the day view should be available to the user.
|Week View Enabled
||Determines if the week view should be available to the user.
|Month View Enabled
||Determines if the month view should be available to the user.
|Default Content View
||Determines the default view that will be opened when the component is loaded.
|Work week view enabled
||Determines if the Work week view is available to the user.
|Week start day
||Determines what is the day the week view must start. Options are Sunday (default) and Monday
Calendar items may include actions. When present, the component will display a menu inside each item to execute those actions.
When using patterns, actions are included automatically depending on the context.
When creating a custom web panel using Web Panel Designer, the developer can add actions using a dataprovider to load calendar items and their corresponding actions. The developer can implement how those actions should behave using the "U_OnActionClicked" subroutine associated with the view.
Aside from the actions described in the previous section, the calendar handles two events:
- Item clicked: executed when the user clicks on an item.
- New draft: executed when the user selects a time period to create a new item.
- DraftCancelled: executed when a draft was being created but is cancelled by a user action.
As with the actions, the implementation for these events is inferred automatically when the calendar view is included in a WorkWith or SubWorkWith interface.
When creating a custom web panel using Web Panel Designer, the developer can implement what should happen when these events occur using the "U_OnItemClicked", "U_OnNewDraft", and "U_DraftCancelled" events.