Loading...
Important Notice - Forums is archived

To simplify things and help our users to be more productive, we have archived the current forum and focus our efforts on helping developers on Stack Overflow. You can post new questions on Stack Overflow or join our Discord channel.

Product icon
TUTORIAL

Vaadin lets you build secure, UX-first PWAs entirely in Java.
Free ebook & tutorial.

double click on table items in vaadin

vikas jain
1 decade ago Feb 20, 2010 5:36am
Jonatan Kronqvist
1 decade ago Feb 22, 2010 8:02am

Hi!

It's really very easy:

table.addListener(new ItemClickEvent.ItemClickListener() {
            private static final long serialVersionUID = 2068314108919135281L;

            public void itemClick(ItemClickEvent event) {
                if (event.isDoubleClick()) {
                     // The item was double-clicked, event.getItem() returns the target.
                }
            }
        });

HTH,
/Jonatan

vikas jain
1 decade ago Feb 23, 2010 9:43am
yayat chibie
9 years ago Dec 17, 2012 12:56pm
Nguyễn Anh Tuấn
8 years ago Jul 26, 2013 2:48pm

table.addListener is deprecated in vaadin 7.
You just simple use table.addItemClickListener
ex:

table.addItemClickListener(new ItemClickListener() {
			@Override
			public void itemClick(ItemClickEvent event) {
				if (!event.isDoubleClick())
					return;
				// do something in here
			}
		});
Rotondwa Gumbu
7 years ago Jan 21, 2015 7:56am
Matthias Brenner
6 years ago Oct 01, 2015 10:02am
Ramil Ahmad
6 years ago Nov 17, 2015 9:52am
Mirko Schmalmak
4 years ago Feb 22, 2018 11:29am

Vaadin 8:

      

grid.addItemClickListener(new ItemClickListener<MyType>() {
            @Override
            public void itemClick(Grid.ItemClick<MyType> event) {
                if (event.getMouseEventDetails().isDoubleClick()) {
                    ...

 

Shaini Sinha
3 years ago Sep 17, 2018 1:03pm