Hi, I have an issue regarding a combobox. When I type something not included in the items list I need to clear the showed value. It works when I select something included in the list, and after type something not included. But when I type another times something not included in the list the value typed remains. As a “very bad” workaround I try also to set a value included in the list and immediately after to clear the value but it doesn’t work. Any suggestion?
countryField = new ComboBox<String>("Country");
// countryField.setTextInputAllowed(false);
countryField.setEmptySelectionAllowed(false);
countryField.setNewItemHandler(new NewItemHandler() {
@Override
public void accept(String arg0) {
// TODO Auto-generated method stub
countryField.setValue("Italy");
countryField.setValue("");
}
});
countryField.addValueChangeListener(new ValueChangeListener<String>() {
@Override
public void valueChange(ValueChangeEvent<String> event) {
// TODO Auto-generated method stub
}
});
countryField.addSelectionListener(new SingleSelectionListener<String>() {
@Override
public void selectionChange(SingleSelectionEvent<String> event) {
_userDataBinder.setCountry(event.getValue());
}
});