ソースを参照

#4213 and #4212 eliminate ComboBox extra value change events for null value


svn changeset:12385/svn branch:6.3
tags/6.7.0.beta1
Henri Sara 14年前
コミット
0c1319e305
1個のファイルの変更12行の追加4行の削除
  1. 12
    4
      src/com/vaadin/terminal/gwt/client/ui/VFilterSelect.java

+ 12
- 4
src/com/vaadin/terminal/gwt/client/ui/VFilterSelect.java ファイルの表示

@@ -447,9 +447,11 @@ public class VFilterSelect extends Composite implements Paintable, Field,
}

public void doSelectedItemAction() {
final MenuItem item = getSelectedItem();
// do not send a value change event if null was and stays selected
final String enteredItemValue = tb.getText();
if (nullSelectionAllowed && "".equals(enteredItemValue)) {
if (nullSelectionAllowed && "".equals(enteredItemValue)
&& selectedOptionKey != null
&& !"".equals(selectedOptionKey)) {
if (nullSelectItem) {
reset();
return;
@@ -484,7 +486,13 @@ public class VFilterSelect extends Composite implements Paintable, Field,
.get(i);
if (potentialExactMatch.getText().equals(enteredItemValue)) {
selectItem(potentialExactMatch);
doItemAction(potentialExactMatch, true);
// do not send a value change event if null was and
// stays selected
if (!"".equals(enteredItemValue)
|| (selectedOptionKey != null && !""
.equals(selectedOptionKey))) {
doItemAction(potentialExactMatch, true);
}
suggestionPopup.hide();
return;
}
@@ -885,7 +893,7 @@ public class VFilterSelect extends Composite implements Paintable, Field,
setPromptingOff(text);
}
setSelectedItemIcon(suggestion.getIconUri());
if (!newKey.equals(selectedOptionKey)) {
if (!(newKey.equals(selectedOptionKey) || ("".equals(newKey) && selectedOptionKey == null))) {
selectedOptionKey = newKey;
client.updateVariable(paintableId, "selected",
new String[] { selectedOptionKey }, immediate);

読み込み中…
キャンセル
保存