From: Matti Tahvonen Date: Thu, 20 May 2010 12:01:41 +0000 (+0000) Subject: fixes focusing issues with Table and IE X-Git-Tag: 6.7.0.beta1~1661 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=eca02f01625a498d7dfc2144cf893a228d2bbee6;p=vaadin-framework.git fixes focusing issues with Table and IE svn changeset:13272/svn branch:6.4 --- diff --git a/src/com/vaadin/terminal/gwt/client/ui/SimpleFocusablePanel.java b/src/com/vaadin/terminal/gwt/client/ui/SimpleFocusablePanel.java index e6c53baccf..967e60d466 100644 --- a/src/com/vaadin/terminal/gwt/client/ui/SimpleFocusablePanel.java +++ b/src/com/vaadin/terminal/gwt/client/ui/SimpleFocusablePanel.java @@ -14,6 +14,7 @@ import com.google.gwt.event.dom.client.KeyPressEvent; import com.google.gwt.event.dom.client.KeyPressHandler; import com.google.gwt.event.shared.HandlerRegistration; import com.google.gwt.user.client.ui.SimplePanel; +import com.google.gwt.user.client.ui.impl.FocusImpl; /** * Compared to FocusPanel in GWT this panel does not support eg. accesskeys, but @@ -45,4 +46,11 @@ public class SimpleFocusablePanel extends SimplePanel implements return addDomHandler(handler, KeyPressEvent.getType()); } + public void setFocus(boolean focus) { + if (focus) { + FocusImpl.getFocusImplForPanel().focus(getElement()); + } else { + FocusImpl.getFocusImplForPanel().blur(getElement()); + } + } } diff --git a/src/com/vaadin/terminal/gwt/client/ui/VScrollTable.java b/src/com/vaadin/terminal/gwt/client/ui/VScrollTable.java index d691e71294..c1e0f1a2c6 100644 --- a/src/com/vaadin/terminal/gwt/client/ui/VScrollTable.java +++ b/src/com/vaadin/terminal/gwt/client/ui/VScrollTable.java @@ -1732,7 +1732,7 @@ public class VScrollTable extends FlowPanel implements Table, ScrollHandler, } else { handleCaptionEvent(event); if (DOM.eventGetType(event) == Event.ONMOUSEUP) { - onFocus(null); + scrollBodyPanel.setFocus(true); } } } @@ -2603,7 +2603,7 @@ public class VScrollTable extends FlowPanel implements Table, ScrollHandler, handleCaptionEvent(event); if (DOM.eventGetType(event) == Event.ONMOUSEUP) { - onFocus(null); + scrollBodyPanel.setFocus(true); } } } @@ -3660,7 +3660,7 @@ public class VScrollTable extends FlowPanel implements Table, ScrollHandler, case Event.ONMOUSEUP: mDown = false; handleClickEvent(event, targetTdOrTr); - onFocus(null); + scrollBodyPanel.setFocus(true); if (event.getButton() == Event.BUTTON_LEFT && selectMode > Table.SELECT_MODE_NONE) { diff --git a/src/com/vaadin/terminal/gwt/client/ui/VTree.java b/src/com/vaadin/terminal/gwt/client/ui/VTree.java index e728ddae54..a8db7c6dd5 100644 --- a/src/com/vaadin/terminal/gwt/client/ui/VTree.java +++ b/src/com/vaadin/terminal/gwt/client/ui/VTree.java @@ -31,7 +31,6 @@ import com.google.gwt.user.client.ui.FlowPanel; import com.google.gwt.user.client.ui.SimplePanel; import com.google.gwt.user.client.ui.UIObject; import com.google.gwt.user.client.ui.Widget; -import com.google.gwt.user.client.ui.impl.FocusImpl; import com.vaadin.terminal.gwt.client.ApplicationConnection; import com.vaadin.terminal.gwt.client.BrowserInfo; import com.vaadin.terminal.gwt.client.MouseEventDetails; @@ -172,14 +171,6 @@ public class VTree extends SimpleFocusablePanel implements Paintable, } } - private void setFocus(boolean focus) { - if (focus) { - FocusImpl.getFocusImplForPanel().focus(getElement()); - } else { - FocusImpl.getFocusImplForPanel().blur(getElement()); - } - } - private void updateActionMap(UIDL c) { final Iterator it = c.getChildIterator(); while (it.hasNext()) {