Xpages Calendar View

2019-07-30 07:53发布

问题:

on my one of my XPages i have to use Calendar view. There is a Notes View. I will use it as XPages Data source then the calendar will Show the data as weekly, Daily and monthly.

is there any sample, suggestion? I found this but there is no sample code or the way how to do? https://www.openntf.org/internal/home.nsf/project.xsp?documentId=E78FED69C5D805E0862576C50050D88B

Regards C.A.

回答1:

Download an ExtLib version from OpenNTF and get the example database "XPagesExt.nsf" from "ExtensionLibraryOpenNTF-901v....zip" file. XPages "DWA_iNotesRest.xsp" and "DWA_LocalCalendarView.xsp" show you how to create a calendar in XPages.

You can find another good example in template "TeamRoom (9)". Create a new database on your server based on this template

and have a look at XPage "calendar" with included custom control "calendarView".

Update

I created a simple example:

<?xml version="1.0" encoding="UTF-8"?>
<xp:view
    xmlns:xp="http://www.ibm.com/xsp/core"
    xmlns:xe="http://www.ibm.com/xsp/coreex">

    <xe:restService
        id="restService1"
        pathInfo="/inoteslegacyjson"
        preventDojoStore="false">
        <xe:this.service>
            <xe:calendarJsonLegacyService
                viewName="calendar"
                contentType="text/plain"
                colCalendarDate="StartDateTime"
                colEndTime="EndDateTime"
                colSubject="Subject"
                colChair="Chair">
            </xe:calendarJsonLegacyService>
        </xe:this.service>
    </xe:restService>

    <xe:calendarView
        id="calendarView1"
        type="W"
        storeComponentId="restService1"
        style="width:100%">
    </xe:calendarView>
</xp:view>

The view is named "calendar"

View's first sorted(!) column has to be the start date/time.
Its programmatic column name is matched to colCalendarDate.

The other three columns are matched the same way.