From bfd1816dc28e09a492697125b9b3b9e97b730d62 Mon Sep 17 00:00:00 2001 From: Artur Signell Date: Fri, 3 Sep 2010 10:43:06 +0000 Subject: Fix for #5539 - Removing the last shortcut from a window won't completely unregister the shortcut on the client side svn changeset:14710/svn branch:6.4 --- src/com/vaadin/event/ActionManager.java | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/com/vaadin/event/ActionManager.java b/src/com/vaadin/event/ActionManager.java index 36e2e21ef5..621a2413b9 100644 --- a/src/com/vaadin/event/ActionManager.java +++ b/src/com/vaadin/event/ActionManager.java @@ -38,6 +38,8 @@ public class ActionManager implements Action.Container, Action.Handler, protected Component viewer; + private boolean clientHasActions = false; + public ActionManager() { } @@ -141,7 +143,11 @@ public class ActionManager implements Action.Container, Action.Handler, actions.addAll(ownActions); } - if (!actions.isEmpty()) { + /* + * Must repaint whenever there are actions OR if all actions have been + * removed but still exist on client side + */ + if (!actions.isEmpty() || clientHasActions) { actionMapper = new KeyMapper(); paintTarget.addVariable(viewer, "action", ""); @@ -175,6 +181,12 @@ public class ActionManager implements Action.Container, Action.Handler, paintTarget.endTag("actions"); } + /* + * Update flag for next repaint so we know if we need to paint empty + * actions or not (must send actions is client had actions before and + * all actions were removed). + */ + clientHasActions = !actions.isEmpty(); } public void handleActions(Map variables, Container sender) { -- cgit v1.2.3