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!