Calendar: handlers and listeners

Hi, I’m trying to set a listener in the exactly same way I can see it’s done in the Calendar documentation (
But I get an error in EventClickListener because it can’t be found and I don’t know what to import (Eclipse always gives me the answer but not in this one)

cal.addListener(new EventClickListener() {
public void eventClick(EventClick event) {
BasicEvent e = (BasicEvent) event.getCalendarEvent();

    // Do something with it
    new Notification("Event clicked: " + e.getCaption(),


[/code]I’m confused because I don’t know if I should set a handler instead:


calendar.setHandler(new EventClickHandler() {

     public void eventClick(EventClick event)
         // TODO Auto-generated method stub

[/code]but in this case Eclipse suggests the following:
“Add arguments to match setHandler(String, Class<?>, EventListener, Method)”

I just want to get a popup with the event details when I click on an event in the calendar. What is the way to do it?

Thank you

Mmm, yes it looks like EventClickListener was changed to EventClickHandler at some point, not sure exactly when, probably long time ago. The section actually mentioned the handler class, but the example didn’t… Oh well.

No, use
the method with just the handler as parameter
. I don’t know why Eclipse shows the protected method with more arguments to you.

The book example is unfortunately NOT in book-examples, but an older one. I’ll maybe update it at some time.

I also saw the Book claims that the Listener classes of the Calendar are in com.vaadin.ui.handler although they really are in com.vaadin.ui.calendar.handler. I know that might not be a big deal but it shows that this page should probably be looked over again to make sure everything is up to date.

Ok, this is really strange…

I check the com.vaadin.addon.calendar.ui.Calendar class and the method is there. Why can’t Eclipse find it?

And it happens the same with a converter I’m trying to add to a ComboBox. When I see which methods are there to add the converter, there are two “setConverter” methods.
I use the one with a Converter bean and then Eclipse tells me to change to the other setConverter


userCombobox.setConverter(new Converter<User, Integer>(){


[/code] I’ve tried with anonymous and non anonymous but nothing works.

Please I really need to sort this out.
Any idea of what is happening out there? I use Vaadin 7.1.

Thank you