I found this link: https://vaadin.com/forum/thread/117302 . I guess my code is similar to this. windowResized method is never called whether I set setImmediate(true); or setImmediate(false);
I am using Vaadin 7.
What is wrong? How to catch the resize event notification?
Thank a lot Martin. But I get the event only if I try to resize the window by dragging the mouse. It doesn’t fire this event when I click maximise/restore button. How can I catch maximise/restore button click?
Unfortunately maximise/restore button click won’t fire the window-resize event. Luckily it fires WindowModeChangeEvent; however even when maximized, the window will still reports the unmaximized width. But we can devise a workaround to poll for the value of Page.getCurrent().getBrowserWindowWidth() when the Window is maximized. The following code snippet summarizes the idea: