Selecting row in Table goes to the previous selected row

Hi there,

I came across something unexpected. I was building a form with a table in which a user can edit data. If you select a row, edit someting, click on another row the focus goes back to the previous selected row. After clicking the other row again, the focus sticks. If you use the Table demo on the main cuba site you can reproduce it. Could you (or can I) change this behaviour?

Kind regards,

Willem.

Hello!

It is known bug (see issue) . Unfortunately, there is no easy fix for this problem.

As a workaround, you can try to replace other non-editable columns to generated with PlainTextCell.

Example
<groupTable id="projectsTable"
            editable="true"
            ...
            dataContainer="projectsDc">
    <columns>
        <column id="name"/>
        <column id="priority" editable="true"/>
        <column id="startDate" editable="true"/>
        <column id="endDate"/>
    </columns>
        ...
</groupTable>
@Inject
private GroupTable<Project> projectsTable;
@Inject
private DatatypeFormatter datatypeFormatter;

@Subscribe
public void onInit(InitEvent event) {
    projectsTable.addGeneratedColumn("name", entity ->
            new Table.PlainTextCell(entity.getName()));

    projectsTable.addGeneratedColumn("endDate", entity ->
            new Table.PlainTextCell(datatypeFormatter.formatDateTime(entity.getEndDate())));
}

The full example you can find here: ftablefocus.zip (81.5 KB)