Previous public visible function MainButton.onClick(EventHandler) marked as deprecated and can be removed in future
Reason:
1) Usually if MainButton is called, there is WebApp in context.
2) If use MainButton.onClick(EventHandler) there is no way to unregister event listener, because lambda created once and passed same time to MainButton.onClick(() -> Unit), reference to it will be not returned.
3) Without MainButton.offClick(() -> Unit) there is no way to unregister event listener, which is useful in different cases when exist some screens with different MainButton configuration and listener inside.
Previous public visible function MainButton.onClick(EventHandler) marked as deprecated and can be removed in future
Reason: 1) Usually if MainButton is called, there is WebApp in context. 2) If use MainButton.onClick(EventHandler) there is no way to unregister event listener, because lambda created once and passed same time to MainButton.onClick(() -> Unit), reference to it will be not returned. 3) Without MainButton.offClick(() -> Unit) there is no way to unregister event listener, which is useful in different cases when exist some screens with different MainButton configuration and listener inside.