}
if (allowNewItem) {
- if (!enteredItemValue.equals(emptyText)) {
+ if (!enteredItemValue.equals(emptyText)
+ && !enteredItemValue.equals(lastNewItemString)) {
+ /*
+ * Store last sent new item string to avoid double sends
+ */
+ lastNewItemString = enteredItemValue;
client.updateVariable(paintableId, "newitem",
enteredItemValue, immediate);
}
private int suggestionPopupMinWidth = 0;
private static final String CLASSNAME_EMPTY = "empty";
private static final String ATTR_EMPTYTEXT = "emptytext";
+ /*
+ * Stores the last new item string to avoid double submissions. Cleared on
+ * uidl updates
+ */
+ private String lastNewItemString;
public IFilterSelect() {
selectedItemIcon.setVisible(false);
suggestionPopup.updateStyleNames(uidl);
allowNewItem = uidl.hasAttribute("allownewitem");
+ lastNewItemString = null;
currentSuggestions.clear();
final UIDL options = uidl.getChildUIDL(0);