Hi,
When my TreeGrid just have one item,I want to trigger this item click event,have any solution?
Thanks.
What is your case actually
-
Do you want to trigger item click event programmatically for a test case?
-
Do you want to observe item click event (which is simply done by adding grid.addItemClickListener(…) )
Tatu Lund:
What is your case actually
Do you want to trigger item click event programmatically for a test case?
Do you want to observe item click event (which is simply done by adding grid.addItemClickListener(…) )
is the 1,but not for my test case, is the business requirements, any advice?
thanks for your help.
The recommended way to do 1. is to use [TestBench]
(https://vaadin.com/testbench) product. It includes Element wrappers for the stock Vaadin components for easier manipulation. For example clicking first row in Grid in a test case would be something like this
GridElement grid = (GridElement) myView.findElement(By.name("my-grid"));
Iterable<GridRowElement> rows = grid.getRows();
rows.iterator().next().click();