How to capture click event in sub-window?

I’m trying to capture the button click event on a button within a subwindow, to be handled by the parent. The parent component (this) implements ClickListenerWindow

newWindow = new Window("test");
MyComponent myComponent = new MyComponent();

I get the following error:

The method addClickListener(ClickListener) in the type FocusWidget is not applicable for the arguments (this)

Is there some other method for capturing events in sub windows that I’m missing?


from your code I assume you’re working on server side. I think you have just imported the wrong Button class in your MyComponent. I guess you’ve imported the GWT class instead of com.vaadin.ui.Button which should be used on the server side.


Wow good catch, that was exactly the problem. I must have clicked the wrong ‘Button’ import choice in Eclipse.