vaadin 7.1.1 : Calendar, cannot reject event move

Hi,
In a calendar, I need to mix “static” events, events user cannot move, and user’s events, those he does can move.
I tried example from manual, section 5.23.14, adding an EventMoveHandler listener and providing my own CalendarEventProvider but though My code doesn’t update event date, event stays where user drop it

I tried this (code simplified) which should cancel any move :


public class CalendrarMainEventProvider implements CalendarEventProvider {
    final List<CalendarEvent> evenements = new ArrayList<CalendarEvent>();

    public CalendriarMainEventProvider() throws InstanceNotFoundException {
        // get data from my dao
        //....
        // loop on my data
        for(....) {
          //.....
          evenements.add(ev);
        }
    }

    @Override
    public List<CalendarEvent> getEvents(Date startDate, Date endDate) {
        return evenements;    
    }
}
//.....
new Calendar(new CalendriarMainEventProvider()) {
	setHandler((CalendarComponentEvents.EventResizeHandler) null);
		setHandler(new CalendarComponentEvents.EventMoveHandler() {
		@Override
		public void eventMove(MoveEvent event) {
			// do nothing, don't update event, move should be canceled
		}

	});
};

I’m getting into eventMove, but event doesn’t move back to its previous schedule - though date for the event remain unchanged (old value)

I tried to update event date, using my own event implementation (instead of BasicEvent), the only thing working what to throw an exception in eventMove. Unfortunately this also raise exception into the UI . extending Calendar and overriding fireEventMove doesn’t work neither…

If i do :


setHandler((CalendarComponentEvents.EventMoveHandler) null);

This prevent any event’s move,that not what i’m looking for. Doing I check after all is not practical neither.

I’m obviously missing something ! is there some kind of ‘setImmediate’ for calendar ? should I force a ‘refresh’/‘repaint’ ?

Note I wont use any container I will provide event into the calendar manually (direct of with a CalendarEventProvider)

Thanks for any help.

Found the start of an answer…
In order to have the calendar displaying correct event’s data I have to to :


//....
@Override
public void eventMove(MoveEvent event) {
//....
 // this actually push data back into the calendar (including modified ones)
// without this line, server and client events are not synchronised
event.getConnector().markAsDirty();
}
//....