Directory

← Back

FullCalendar Scheduler for Flow

Full Calendar Scheduler for the Vaadin Framework 14+

Author

Contributors

Rating

This addon extends the FullCalendar for Flow addon with the FullCalendar Scheduler, which provides additional resource based views (Timeline View and Vertical Resource View) for Vaadin 14+.

It is based on the version 6.1.6 of the FullCalendar Scheduler library.

It needs the basic addon (https://vaadin.com/directory/component/full-calendar-flow) to work. Since this addon is not always updated when the basis gets an update, I suggest, that you add both dependencies (basis and extension) to always use the latest versions. This extension is compatible as long as the readme does not tells anything else.

Requirements / versions / support

The addon is built against Vaadin 14.x and Java 8, but is intended to be used with the latest major Vaadin version and thus also supports Vaadin 23 and 24 / Java 11+.

Addon versions prior to the current major version are not supported anymore. If you need a fix for such a version feel free to fork the project. You may create an issue, but due to limited time it is very unlikely, that we will fix it.

Please also have a look at the demo for some basic examples and source code of how to integrate the FC. For more examples please have a look into the example section.

For information about the Scheduler (functionality, features, license information, etc.) visit https://fullcalendar.io/scheduler.

For a Vaadin 10-13 version (that is built on FC 3.10.x), see https://vaadin.com/directory/component/full-calendar-scheduler-extension-vaadin10

License information:

Please be aware, that the FullCalender Scheduler library this addon is based on has a different license model then the basic FullCalendar. For details about the license, visit https://fullcalendar.io/license.

This addon does not provide any commercial license for the Scheduler. The license model of MIT does only affect the additional files of this addon, not the used original files.

Activating the Scheduler

By default the scheduler is not active, when you use a FullCalendar instance. To have an instance with scheduler activated, use the withScheduler() method of the FullCalendarBuilder.

This method will throw an exception, if the scheduler extension is not on the class path.

To link a resource with entries, use the Entry subclass ResourceEntry.

Building with V14

It might be, that the transitive dependencies are not resolved correctly.

If you are using Spring Boot please add the @EnableVaadin annotation to your application class. Add the package org.vaadin.stefan plus your root package as parameters. This should enable Spring to analyze all npm dependencies at runtime. Other CDI version should work the same.

If you are not using Spring, but have similiar issues try to add also the goal build-frontend to the vaadin maven plugin. This should resolve transitive npm dependencies at build time.

For instance:

<plugin>
    <groupId>com.vaadin</groupId>
    <artifactId>vaadin-maven-plugin</artifactId>
    <version>${vaadin.version}</version>
    <executions>
        <execution>
            <goals>
                <goal>prepare-frontend</goal>
                <goal>build-frontend</goal>
            </goals>
        </execution>
    </executions>
</plugin>

Additional Features of the Scheduler extension

  • Activation of the Scheduler by method in the FullCalendarBuilder.
  • Adding resources to a calendar (hierarchies of resources are not yet supported).
  • Link one or multiple resources with entries.
  • List of possible Scheduler based views (timeline).

Info: Entries are linked to calendar internally. The calendar instance is used to resolve resources by after updating an entry on the client side.

Feedback and co.

If there are bugs or you need more features (and I'm not fast enough) feel free to contribute on GitHub. :) I'm also happy for feedback or suggestions about improvements.

Sample code

FullCalendar calendar = FullCalendarBuilder.create().withScheduler().build();

// scheduler options
((Scheduler) calendar).setSchedulerLicenseKey(...);
Resource resource = new Resource(null, s, color);
calendar.addResource(resource);

// When we want to link an entry with a resource, we need to use ResourceEntry,
// which is a subclass of Entry. 
ResourceEntry entry = new ResourceEntry();

// ... initialize as normal entries

entry.setResource(resource);
calendar.addEntry(entry);
calendar.addEntryDroppedListener(event -> {
    event.applyChangesOnEntry();

    Entry entry = event.getEntry();

    if(entry instanceof ResourceEntry) {
        Set<Resource> resources = ((ResourceEntry) entry).getResources();
        if(!resources.isEmpty()) {
            // do something with the resource info
        }
    }
});
calendar.changeView(SchedulerView.RESOURCE_TIME_GRID_WEEK);
ResourceEntry entry = new ResourceEntry();
// ... setup entry details, including addResource()

entry.setRenderingMode(Entry.RenderingMode.BACKGROUND);
calendar.addEntry(entry);
// Create a parent resource. When adding the sub resources first before adding the parent to the calendar,
// the sub resources are registered automatically on client side and server side.

Resource parent = new Resource();
parent.addChildren(new Resource(), new Resource(), new Resource());

calendar.addResource(parent); // will add the resource and also it's children to server and client

// add new resources to already registered parents
Resource child = new Resource()
parent.addChild(child);
calendar.addResource(child); // this will update the client side

// or remove them from already registered ones
calendar.removeResource(child); 
parent.removeChild(child); 
// activate for the client to have an entry being draggable between resources
resourceEntry.setResourceEditableOnClientSide(true);

// update the entry on the client side, if it is already added to the calendar
calendar.updateEntry(resourceEntry);

Compatibility

(Loading compatibility data...)

Was this helpful? Need more help?
Leave a comment or a question below. You can also join the chat on Discord or ask questions on StackOverflow.

Version

New major version release. Please check our github wiki for details regarding release notes, migration guides and samples :)

https://github.com/stefanuebe/vaadin_fullcalendar/wiki

Released
2023-05-05
Maturity
STABLE
License
MIT License

Compatibility

Framework
Vaadin 14+
Browser
Browser Independent
Online