Doubleclick listener on Vaadin Grid

心已入冬 提交于 2019-12-25 18:09:20

问题


How do I add a 2x click listener on a vaadin grid? When I 2x click on it, it takes me to another page. Example would be most appreciated.


回答1:


With the MouseEvent you can simply ask for a double click.

See here #MouseEvents.ClickEvent.html#isDoubleClick()




回答2:


Here is an example:

grid.addItemClickListener(listener -> 
    { 
       if (listener.getMouseEventDetails().isDoubleClick())
          // pass the row/item that the user double clicked
          // to method doStuff.
          doStuff(l.getItem());
    }
);


来源:https://stackoverflow.com/questions/33356734/doubleclick-listener-on-vaadin-grid

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!