Andreas Johansson Andreas Johansson - 9 days ago 6
Java Question

Vaadin - Trigger button click within table

In Vaadin, is it possible to simulate the click of a button which is located within a Table?

e.g:

table.getCellContent(tableRowId, columnRowId).clickButton()


The reason that I'm asking is since I need this for testing purposes.

Answer

The following works in Vaadin 6.8.0 and later versions:

((Button) table.getContainerProperty(tableRowId, columnRowId).getValue()).click();