禁用日历事件移动 - Vaadin

Disable calendar event moving - Vaadin

我想禁用来自 Vaadin 日历的移动事件

All of these handlers are automatically set when creating a new Calendar. If you wish to disable some of the default functionality, you can simply set the corresponding handler to null. This will prevent the functionality from ever appearing on the user interface. For example, if you set the EventMoveHandler to null, the user will be unable to move events in the browser. --> Book of Vaadin

我试过了:

calendar.setHandler(null);

calendar.setHandler((EventMoveHandler) null);
calendar.setHandler((BaseEventMoveHandler) null);

EventMoveHandler handler = null;
calendar.setHandler(handler);

BaseEventMoveHandler baseHandler = null;
calendar.setHandler(baseHandler );

但没有任何效果。有什么建议....?

Vaadin 7.4.5 真的很适合我:

calendar.setHandler((EventMoveHandler)null);
calendar.setHandler((EventResizeHandler)null);

如果您想禁用所有处理程序并使日历完全只读,这对我有用。

calendar.setReadOnly(true);

编辑1: 然而,这种方法不会禁用事件的调整大小指针。因此,我看到的最佳解决方案是将它与 asmellado 的答案一起使用:

calendar.setReadOnly(true);
calendar.setHandler((EventMoveHandler)null);
calendar.setHandler((EventResizeHandler)null);

此外,如果我没有使用 setReadOnly 方法,当我尝试移动事件时,我 运行 出现了一些客户端异常。