Tree item and DoubleClick

hello,
Is there a way to detect a double click event in an tree item?

thanks in advance

Yes it is. See the itemclicklistener sample from Sampler.

Hi Jouni,
I used the
ItemClickListener
to add
single click
listener for
tree
, that works perfectly:

ItemClickListener treeclick = new ItemClickListener(){
	
		@Override
		public void itemClick(final ItemClickEvent event) {
                                 getWindow().showNotification(
			                               "Notification",
			                               event.getItemId().toString(),
			                                Notification.TYPE_WARNING_MESSAGE);
			}
}

But when I would allow
double click event
to the
tree
, I use the
isDoubleClick()
method:

ItemClickListener treeclick = new ItemClickListener(){
	
		@Override
	public void itemClick(final ItemClickEvent event) {
          if(event.isDoubleClick()){
                               getWindow().showNotification(
			                          "Notification",
			                           event.getItemId().toString(),
			                            Notification.TYPE_WARNING_MESSAGE);
			}
         }
 }

No result for this instruction :frowning:

I note that the
isDoubleClick()
is from
com.vaadin.event.MouseEvents.ClickEvent
, and the tree event is from
com.vaadin.event.ItemClickEvent
, is there the problem?
It is possible to use the
clickEvent
for tree instead of the
ItemClickEvent
?

is there someone can respond??

As far as I can tell, the click behavior in this case is buggy. I suggest you create a bug report in the
bug tracker
.