ComboBox crashes

Hi,
Could somebody try next comboBox and explain me why it crashes with multiple exceptions?
(It is based in the sampler demo. ExampleUtil companion class is needed)

public class ComboIdiomas extends ComboBox implements ValueChangeListener {
	
	public ComboIdiomas() {
    	this.setCaption("Country");

    	this.setContainerDataSource(ExampleUtil.getISO3166Container());
    	
        // Sets the combobox to show a certain property as the item caption
        this.setItemCaptionPropertyId(ExampleUtil.iso3166_PROPERTY_NAME);
        this.setItemCaptionMode(AbstractSelect.ITEM_CAPTION_MODE_PROPERTY);

        // Sets the icon to use with the items
        this.setItemIconPropertyId(ExampleUtil.iso3166_PROPERTY_FLAG);

        this.setImmediate(true); //Also try false

		//THIS LINE IS THE PROBLEM!!
        this.addListener((ValueChangeListener)this);        
    }

    public void valueChange(ValueChangeEvent event) {
        Property selected = ExampleUtil.getISO3166Container()
                .getContainerProperty(event.getProperty().toString(), "name");
        getWindow().showNotification("Selected country: " + selected);
    }
}

Thanks!

Could you please give us a stack trace? Especially the “Caused by” part is of importance.

Thanks for your interest

Is a kind of infinite com.vaadin.event.ListenerMethod$MethodException
11807.png

I think the following code is the cause of your problem:

public void valueChange(ValueChangeEvent event) {
    yearComboBoxlistener.yearChange((Integer)getValue());
}

Try this instead:

public void valueChange(Property.ValueChangeEvent event) {
    yearComboBoxlistener.yearChange((Integer)getValue());
}

This is because without specifying Property.ValueChangeEvent, Eclipse decided to import Field.ValueChangeEvent instead.