actionManager & removeShortcutListener

Hello,

I am not sure if this is a bug or a Layer 8-Problem.

I am adding and removing Shortcut-Listeners by calling AbstractComponent#addShortcutListener() and
AbstractComponent#removeShortcutListener().

If we have a look at the code from Vaadin 7.1.15 we see:
public void addShortcutListener(ShortcutListener shortcut) {


getActionManager()

.addAction(shortcut);
}

public void removeShortcutListener(ShortcutListener shortcut) {
if (


actionManager


!= null) {



actionManager


.removeAction(shortcut);
}
}

The code will cause errors in all UI Components that override getActionManager() but not removeShortcutListener() like Panel, UI and Window. I got a view “out of sync error” messages after removing ShortcutListeners from a Panel and the Panel from the UI. The errors were gone with my own Panel impl:

public class Panel extends com.vaadin.ui.Panel {

/* ------------------------------------------------------------- *
 * Constructors
 * ------------------------------------------------------------- */
...

/** {@inheritDoc} */
@Override
public void removeShortcutListener(ShortcutListener shortcut) {
    getActionManager().removeAction(shortcut);
}

}

Also com.vaadin.ui.CheckBox does not implement FieldEvents.BlurNotifier, FieldEvents.FocusNotifier but provides the appropriate methods.

Hello,

I think this is a bug. I was not able reproduce the “out of sync” error but the shortcut listener added to a panel does not get removed in my test for the same reason… It seem that the same problem is also in the newest Vaadin 7.2 version.

Would you like to report this as a bug? If so, do it here: http://dev.vaadin.com/wiki/SubmittingBug
If not, please inform me so I can write a bug report.

Hi, I will report it.