Buy me a coffee :)

Wicket - jQuery UI

jQuery UI integration in Wicket 6.x, Wicket 7.x , Wicket 8.x & Wicket 9.x

Calendar: public feeds


Components / Samples

Description

This sample shows how to add public feeds to the Calendar.

Sources

package com.googlecode.wicket.jquery.ui.samples.jqueryui.calendar;

import com.googlecode.wicket.jquery.core.Options;
import com.googlecode.wicket.jquery.ui.calendar.Calendar;
import com.googlecode.wicket.jquery.ui.calendar.EventSource.GoogleCalendar;
import com.googlecode.wicket.jquery.ui.panel.JQueryFeedbackPanel;

public class DefaultCalendarPage extends AbstractCalendarPage
{
	private static final long serialVersionUID = 1L;

	public DefaultCalendarPage()
	{
		// FeedbackPanel //
		this.add(new JQueryFeedbackPanel("feedback"));

		// Calendar //
		Options options = new Options();
		options.set("theme", true);
		options.set("googleCalendarApiKey", Options.asString(GCAL_API_KEY));

		Calendar calendar = new Calendar("calendar", options) {

			private static final long serialVersionUID = 1L;

			@Override
			public boolean isSelectable()
			{
				return true;
			}

			@Override
			public boolean isEventDropEnabled()
			{
				return true;
			}

			@Override
			public boolean isEventResizeEnabled()
			{
				return true;
			}
		};

		this.add(calendar);

		GoogleCalendar gcal1 = new GoogleCalendar("qde8vmooe48vsm1ma3i9je88q8@group.calendar.google.com");
		/* gcal1.setGoogleCalendarApiKey(GCAL_API_KEY); */
		calendar.addSource(gcal1.setColor("#993366"));

		GoogleCalendar gcal2 = new GoogleCalendar("nerseigospses068jd57bk5ar8@group.calendar.google.com" /* , GCAL_API_KEY */);
		calendar.addSource(gcal2.setColor("#cc6666"));

		GoogleCalendar gcal3 = new GoogleCalendar("p2v08r7sgvos2dnkkchreur9u8@group.calendar.google.com"); // Wicket jQuery UI Calendar
		gcal3.setEditable(true);
		gcal3.setColor("#6666cc");
		calendar.addSource(gcal3);
	}
}
<!DOCTYPE html>
<html xmlns:wicket="http://wicket.apache.org">
<head>
<wicket:head>
	<title>Wicket jQuery UI: calendar / event sources</title>
</wicket:head>
</head>
<body>
<wicket:extend>
	<div id="demo-panel">
		<div wicket:id="calendar"></div>
		<br/>
		<div wicket:id="feedback"></div>
	</div>
</wicket:extend>
</body>
</html>