FullCalendar.events.tplPackageTextTemplate resource that defines the JavaScript event-fetching callback injected into each FullCalendar event source's configuration. This single template file is the critical bridge between the Wicket server and the FullCalendar client: it generates a JavaScript function that makes a Wicket Ajax GET request to a dynamically-generated URL (unique per event source), passing the calendar's visible date range (start/end as epoch milliseconds), the client's timezone offset, and an anti-cache token. The response is passed directly to FullCalendar's callback as the event data array.The template uses Wicket's TextTemplate variable substitution syntax: ${url} is the only variable. At render time, FullCalendar.setupCallbacks() creates a HashMap with the key "url" set to the event source's Ajax callback URL (generated by Wicket.Ajax.ajax), and calls EVENTS.asString(map) to produce the final JavaScript.
The generated JavaScript makes a Wicket Ajax call with parameters:
"u" — the callback URL unique to each event source"dt": "json" — expects JSON response"wr": false — don't use Wicket's Ajax response processing (the raw JSON is the event list)"ep" (extra parameters): start and end (epoch milliseconds from FullCalendar's start/end callback arguments), timezoneOffset (client's UTC offset in minutes), anticache (timestamp + random to prevent browser caching)"sh" (success handler) — passes the jqXHR response directly to FullCalendar's callback, effectively providing the event data arrayWicket's PackageTextTemplate locates this file by convention: it must be in the same Java package (net.ftlines.wicket.fullcalendar) as the FullCalendar class and have the same base name. The .tpl extension signals it's a text template resource.
| Commit | What changed |
|---|---|
9ebb88522 | Added the template file as part of the initial repository commit. The Ajax protocol (Wicket Ajax call with epoch timestamps, timezone offset, and anti-cache token) was established from the beginning and has remained unchanged — a testament to the stability of both Wicket's Ajax API and FullCalendar's event source protocol. |