Vaadin 7.3.1 Double click on Tree item does not work

Hi,

Vaadin version 7.3.1.
Double click on Tree does not work.

import javax.servlet.annotation.WebServlet;
import com.vaadin.annotations.Theme;
import com.vaadin.annotations.VaadinServletConfiguration;
import com.vaadin.event.ItemClickEvent;
import com.vaadin.server.VaadinRequest;
import com.vaadin.server.VaadinServlet;
import com.vaadin.ui.Notification;
import com.vaadin.ui.Tree;
import com.vaadin.ui.UI;
import com.vaadin.ui.VerticalLayout;
import com.vaadin.ui.themes.ValoTheme;

@Theme(ValoTheme.THEME_NAME)
@SuppressWarnings(“serial”)
public class MyVaadinUI extends UI {

@WebServlet(value = "/*", asyncSupported = true)
@VaadinServletConfiguration(productionMode = false, ui = MyVaadinUI.class)
public static class Servlet extends VaadinServlet {
}

@Override
protected void init( VaadinRequest request ) {
    final VerticalLayout layout = new VerticalLayout();
    setContent( layout );

    ItemClickEvent.ItemClickListener listener = new ItemClickEvent.ItemClickListener() {
        @Override
        public void itemClick( ItemClickEvent event ) {
            if ( event.isDoubleClick() ) {
                Notification.show( "DOUBLE CLICK! : " + event.getItemId() );
            }
        }
    };

    Tree tree1 = new Tree( "With ItemClickListener" );
    tree1.addItem( "Menu Item 1" );
    tree1.addItem( "Menu Item 2" );

    tree1.addItemClickListener( listener );
    tree1.setNullSelectionAllowed( false );

    layout.addComponents( tree1 );
}

}

I have noticed that it seems like immediate mode is not working for double clicks. If I do a double click on a tree element, nothing happens. But if I expand or collapse a node after doing a double click, the double click event gets sent at that point.

Hey Dmitry, could you define “not working”? What is the expected behaviour?

Paul, I tried the code above, and the double click always seem to get registered.

With the code above, on Vaadin 7.3.0, the double click works as expected. It immediately shows the notification. As soon as I upgrade the project to 7.3.1, the double click listener no longer fires immediately after I perform a double click. Instead, the notification is shown when I expand or collapse a node. It seems as if the event is held until some other action occurs. My browser is Google Chrome.

I fully agree with Paul. That’s what I meant.

Same behavior here. Reproduced in IE and Firefox. Seems to work on Chrome.
Is this a confirmed bug/regression ? Did somebody filled a TRAC ticket ?

There is currently no ticket.

Ticket added in TRAC :

http://dev.vaadin.com/ticket/14745

I’m suffering from this on Chrome and Vaadin 7.7.10.