Vaadin table when adding new row losing its focus.

I am using vaadin table with components in each row, and when iam adding a new row and setting the focus on the new row first column, it is not getting focusuable, the focus is still in the previous row.


Sample Code : iam using to focus is as follows.



Object lastItemId = table.lastItemId();
TextField textField = (TextField) table.getcontainerProperty(lastItemId, propertyId).getValue();
textField.focus();

can you paste the preceding example code? It may be that it is run table.lastItemId before add the new row?