O'Reilly logo

PrimeFaces Cookbook - Second Edition by Oleg Varaksin, Mert Çalışkan

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Managing events with schedule by leveraging lazy loading

The Schedule component provides a calendar to manage events, such as Outlook Calendar and iCal. By default, a whole set of events is eagerly provided via the ScheduleModel class. That means all events are loaded at once on page load. The lazy loading feature helps to improve performance if we have a huge dataset of events or if events take too much time to load. In the lazy loading mode, only events that belong to the displayed timeframe are fetched.

In this recipe, we will implement a small example for the Schedule component's lazy loading feature.

How to do it…

A basic definition of schedule would be as shown here:

<p:schedule id="lazySchedule"
  value="#{scheduleBean.lazyScheduleModel}"/>

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required