I have got class MyCustomWindow which extends Window (com.vaadin.ui) from vaadin. When you click some button MyCustomWindow will show. Now I would like to add button to this window and when you push this buton it will close the window. I have got problem what to use to remove this window. I have found:
Window w = getWindow();
getApplication().removeWindow(w);
or
Window w = this.findAncestor(Window.class);
w.close();
But it doesn't work. I would like to remove window from inside the class, not from outside, using "this"? Something like:
UI.getCurrent().removeWindow(this);
I am using vaadin 7. Can you help me?