From: Jouni Koivuviita Date: Wed, 7 Oct 2009 12:13:40 +0000 (+0000) Subject: Fixes #3487: ReadOnlyExceptions for read-only ComboBox X-Git-Tag: 6.7.0.beta1~2423 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=7c36939ff0572051f0b073e040eff78677948e40;p=vaadin-framework.git Fixes #3487: ReadOnlyExceptions for read-only ComboBox * a read-only ComboBox sent a change event after focus->blur events. svn changeset:9128/svn branch:6.2 --- diff --git a/src/com/vaadin/terminal/gwt/client/ui/VFilterSelect.java b/src/com/vaadin/terminal/gwt/client/ui/VFilterSelect.java index 9d1482952c..c349497aa3 100644 --- a/src/com/vaadin/terminal/gwt/client/ui/VFilterSelect.java +++ b/src/com/vaadin/terminal/gwt/client/ui/VFilterSelect.java @@ -1037,7 +1037,7 @@ public class VFilterSelect extends Composite implements Paintable, Field, public void onFocus(FocusEvent event) { focused = true; - if (prompting) { + if (prompting && !readonly) { setPromptingOff(""); } addStyleDependentName("focus"); @@ -1045,24 +1045,26 @@ public class VFilterSelect extends Composite implements Paintable, Field, public void onBlur(BlurEvent event) { focused = false; - // much of the TAB handling takes place here - if (tabPressed) { - tabPressed = false; - suggestionPopup.menu.doSelectedItemAction(); - suggestionPopup.hide(); - } else if (!suggestionPopup.isAttached() - || suggestionPopup.isJustClosed()) { - suggestionPopup.menu.doSelectedItemAction(); - } - if (selectedOptionKey == null) { - setPromptingOn(); + if (!readonly) { + // much of the TAB handling takes place here + if (tabPressed) { + tabPressed = false; + suggestionPopup.menu.doSelectedItemAction(); + suggestionPopup.hide(); + } else if (!suggestionPopup.isAttached() + || suggestionPopup.isJustClosed()) { + suggestionPopup.menu.doSelectedItemAction(); + } + if (selectedOptionKey == null) { + setPromptingOn(); + } } removeStyleDependentName("focus"); } public void focus() { focused = true; - if (prompting) { + if (prompting && !readonly) { setPromptingOff(""); } tb.setFocus(true);