aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJohn Alhroos <john.ahlroos@itmill.com>2011-07-27 07:39:27 +0000
committerJohn Alhroos <john.ahlroos@itmill.com>2011-07-27 07:39:27 +0000
commit740cc6a43daf3b828a6d1c88ff85789423cd2a90 (patch)
tree9db5124a42469be4710f839a7ac3b29a46d1b382
parenta4a26db491692d364d6707bc7fb83b59ff2fd205 (diff)
downloadvaadin-framework-740cc6a43daf3b828a6d1c88ff85789423cd2a90.tar.gz
vaadin-framework-740cc6a43daf3b828a6d1c88ff85789423cd2a90.zip
Fixes issue where ItemClickEvent not getting triggered when selecting an item in an unfocused Tree in webkit #7317
svn changeset:19963/svn branch:6.6
-rw-r--r--src/com/vaadin/terminal/gwt/client/ui/VTree.java24
1 files changed, 21 insertions, 3 deletions
diff --git a/src/com/vaadin/terminal/gwt/client/ui/VTree.java b/src/com/vaadin/terminal/gwt/client/ui/VTree.java
index ef08e81e10..eb8a2e63c5 100644
--- a/src/com/vaadin/terminal/gwt/client/ui/VTree.java
+++ b/src/com/vaadin/terminal/gwt/client/ui/VTree.java
@@ -511,9 +511,27 @@ public class VTree extends FocusElementPanel implements Paintable,
* Sends the selection to the server
*/
private void sendSelectionToServer() {
- client.updateVariable(paintableId, "selected", selectedIds
- .toArray(new String[selectedIds.size()]), immediate);
- selectionHasChanged = false;
+ Command command = new Command() {
+ public void execute() {
+ client.updateVariable(paintableId, "selected",
+ selectedIds.toArray(new String[selectedIds.size()]),
+ immediate);
+ selectionHasChanged = false;
+ }
+ };
+
+ /*
+ * Delaying the sending of the selection in webkit to ensure the
+ * selection is always sent when the tree has focus and after click
+ * events have been processed. This is due to the focusing
+ * implementation in FocusImplSafari which uses timeouts when focusing
+ * and blurring.
+ */
+ if (BrowserInfo.get().isWebkit()) {
+ Scheduler.get().scheduleDeferred(command);
+ } else {
+ command.execute();
+ }
}
/**