Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse Scout » Filter calendar items(Filter calendar items)
Filter calendar items [message #791205] Sun, 05 February 2012 12:50 Go to next message
Bertin Kiekebosch is currently offline Bertin KiekeboschFriend
Messages: 330
Registered: August 2011
Senior Member
The calendar has a method execFilterCalendarItems that is executed when items are loaded. I call the database and load all the appointments of a user for a particular week. This is a heavy operation on the database that results for average a few 200 appointments.

I want to give the user a menu with options to filter the items on the calendar. How can I trigger the execFilterCalendarItems but not reload everything from the database.

Regards bertin
Re: Filter calendar items [message #793020 is a reply to message #791205] Tue, 07 February 2012 17:14 Go to previous messageGo to next message
Matthias Villiger is currently offline Matthias VilligerFriend
Messages: 232
Registered: September 2011
Senior Member
Hi Bertin,

The execFilterCalendarItems method is only invoked, when new items have been loaded from the providers.

The easiest way to achieve your task would be to introduce some logic in the method execLoadItems (or execLoadItemsInBackground) to only fetch the data from the database when the date range has changed.
For this you can remember the last range (minDate, maxDate) for each provider and only fetch data from the database when it is different than the last time. If it is the same range you can just add the already existing items into the holder (you can access them using getCalendar().getComponents()).
Then you can trigger a reload on the calendar by calling reloadCalendarItems(). This invokes execLoadItems (which does no DB call anymore) and afterwards execFilterCalendarItems which gives you the opportunity to apply the new filter.

Does this answer your question?
Regards,
Matthias
Re: Filter calendar items [message #793123 is a reply to message #793020] Tue, 07 February 2012 20:08 Go to previous message
Bertin Kiekebosch is currently offline Bertin KiekeboschFriend
Messages: 330
Registered: August 2011
Senior Member
Hi Matthias,

I figured out something simular, but with your answer I know now I am not doing something in a completely wrong way that could be done more easily by using Scout in a better way.

Regards Bertin
Previous Topic:Start application with parameters
Next Topic:AbstractImageField with scrollbar
Goto Forum:
  


Current Time: Fri Apr 26 09:45:23 GMT 2024

Powered by FUDForum. Page generated in 0.02756 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top