diff options
Diffstat (limited to 'src/com/vaadin/terminal')
-rw-r--r-- | src/com/vaadin/terminal/gwt/client/ui/VTextField.java | 3 | ||||
-rw-r--r-- | src/com/vaadin/terminal/gwt/client/ui/VView.java | 4 |
2 files changed, 7 insertions, 0 deletions
diff --git a/src/com/vaadin/terminal/gwt/client/ui/VTextField.java b/src/com/vaadin/terminal/gwt/client/ui/VTextField.java index 334f2617a5..49d18f0867 100644 --- a/src/com/vaadin/terminal/gwt/client/ui/VTextField.java +++ b/src/com/vaadin/terminal/gwt/client/ui/VTextField.java @@ -326,6 +326,9 @@ public class VTextField extends TextBoxBase implements Paintable, Field, protected void onDetach() { super.onDetach(); detachCutEventListener(getElement()); + if (focusedTextField == this) { + focusedTextField = null; + } } @Override diff --git a/src/com/vaadin/terminal/gwt/client/ui/VView.java b/src/com/vaadin/terminal/gwt/client/ui/VView.java index 2d47790dab..ea43deba9d 100644 --- a/src/com/vaadin/terminal/gwt/client/ui/VView.java +++ b/src/com/vaadin/terminal/gwt/client/ui/VView.java @@ -505,6 +505,10 @@ public class VView extends SimplePanel implements Container, ResizeHandler, public void onWindowClosing(Window.ClosingEvent event) { // Change focus on this window in order to ensure that all state is // collected from textfields + // TODO this is a naive hack, that only works with text fields and may + // cause some odd issues. Should be replaced with a decent solution, see + // also related BeforeShortcutActionListener interface. Same interface + // might be usable here. VTextField.flushChangesFromFocusedTextField(); // Send the closing state to server |