diff options
Diffstat (limited to 'server/src/com/vaadin/ui/ComboBox.java')
-rw-r--r-- | server/src/com/vaadin/ui/ComboBox.java | 22 |
1 files changed, 12 insertions, 10 deletions
diff --git a/server/src/com/vaadin/ui/ComboBox.java b/server/src/com/vaadin/ui/ComboBox.java index c66aee0b34..189cf20aab 100644 --- a/server/src/com/vaadin/ui/ComboBox.java +++ b/server/src/com/vaadin/ui/ComboBox.java @@ -76,7 +76,18 @@ public class ComboBox extends AbstractSelect implements } private ComboBoxServerRpc rpc = new ComboBoxServerRpc() { - + @Override + public void createNewItem(String itemValue) { + if (isNewItemsAllowed()) { + // New option entered (and it is allowed) + if (itemValue != null && itemValue.length() > 0) { + getNewItemHandler().addNewItem(itemValue); + // rebuild list + filterstring = null; + prevfilterstring = null; + } + } + } }; /** @@ -733,15 +744,6 @@ public class ComboBox extends AbstractSelect implements filterstring = filterstring.toLowerCase(getLocale()); } requestRepaint(); - } else if (isNewItemsAllowed()) { - // New option entered (and it is allowed) - final String newitem = (String) variables.get("newitem"); - if (newitem != null && newitem.length() > 0) { - getNewItemHandler().addNewItem(newitem); - // rebuild list - filterstring = null; - prevfilterstring = null; - } } if (variables.containsKey(FocusEvent.EVENT_ID)) { |