using setDisableOnClick(true) and setClickShortcut()

Hi there,

We have a button where we enabled the setDisableOnClick(true) and setClickShortcut(KeyCode.ENTER). According to the doc setDisableOnClick(true) is only used when the click comes from the user, not when calling click(). Not sure if this is related to the behavior we are noticing. But the fact is than we press the shortcut key assigned with setClickShortcut() the button is not being disabled.

Is this the way it is designed to work? We are on version 7.3.2

Many thanks,

Check this:

        VerticalLayout layout = new VerticalLayout();

        Button btn = new Button("Click Me");
        btn.addClickListener(new ClickListener() {
            public void buttonClick(ClickEvent event) {


By default, the enter key is a click shortcut when focused. In the last line I’ve set the focus on the button, then just press the enter key it is disabled confomre your event. But set a shortcut click, which is the DELETE key, pressing it calls the listener, but not disabled, which seem to only work when the event is fired directly on the button and not the shortcut. Maybe you found a bug (:

Hola Gabriel,

Thanks for the comment. If you set the “ClickShortcut” you don’t even need to set the focus on the button to mimmic the click when you press the associated key, that’s the advantage.

It might be a bug, but before opening a ticket just want to make sure if this is the way it should work. That said, it wouldn’t make much sense.

Many thanks,

I have a similiar problem with setClickShortcut. I’m working with Vaadin 7.3.5.

This is my code:
c_btnBack.addClickListener(new ClickListener() {

        public void buttonClick(ClickEvent event) {

This doesn’t work me, any suggestion?

Thanks a lot for advanced!

I agree this seems a bug :frowning:

I’ve checked the code and internally Vaadin uses click() when the shortcut is pressed. Therefore no disabling. If you think this should be changed, file a ticket and we’ll discuss it.

This code works for me in Chrome and FF on Mac. In which browser are you testing it?

Hi Michael, please see

Thanks Luis, I’ll take a look.