Erratic Shortcut Behavior (Sensitive to focus. Javascript issue?)

Hi,

In our application we use shortcuts to allow users to delete nodes of a Tree.
Users are expected to select a node of the tree and press Ctrl+Delete to delete it.
However, the shortcut becomes unresponsive at times, forcing users to click some other area of the screen after having selected the node. This workaround is very consistent and always work.

I debugged the application and identified the chain of calls that lead to my shortcut listener when the application behaves as expected. I added breakpoints all along the stack, but nothing goes to the server when the shortcut fails, leading me to believe that this is a Javascript issue. I tried debugging the Javascript code, but Vaadin’s/GWT’s code is too cryptic, and I didn’t go too far with that.

The following code snippet illustrates how the ShortcutListener is initialized and bound to the tree. Nothing special here.


view.getMenuTree().addShortcutListener(
				new ShortcutListener("Delete Item",
						ShortcutAction.KeyCode.DELETE,
						new int[] { ShortcutAction.ModifierKey.CTRL }) {

					@Override
					public void handleAction(Object sender, Object target) {
						ToolbarItem selectedItem;
						Object selectedTreeItem;

						selectedTreeItem = view.getMenuTree().getValue();
						if (selectedTreeItem != null) {
							selectedItem = (ToolbarItem) container.getItem(
									selectedTreeItem).getItemProperty(
									TBITEM_PROPERTY_ID).getValue();

							if (selectedItem != null
									&& selectedItem.isDeletable()) {
								bus.fireEvent(new Event<ToolbarItem>(
										VicinioEventType.ToolbarItemDeleteRequest,
										selectedItem));
							}
						}
					}

				});

Hopefully you guys will be able to shed some light.

Thanks a lot,
Rafael