Grid not selectable

Platform: vaadin 8.3.3, TouchKit 5.0.0

I’m creating a Grid in this way:

        Grid<TransactionType> jobtypesTable = new Grid<>(TransactionType.class);
        jobtypesTable.setDataProvider(jobTypes);
        jobtypesTable.setSelectionMode(SelectionMode.SINGLE);
        jobtypesTable.removeColumn("id");
        jobtypesTable.removeColumn("transactionIsWork");
        jobtypesTable.removeColumn("transactionIsWagePayment");
        Column<TransactionType, ?> nameColumn = jobtypesTable.getColumn("transactionTypeName").setCaption("Navn");
        Column<TransactionType, ?> amountColumn = jobtypesTable.getColumn("transactionAmount").setCaption("Beløp");
        jobtypesTable.setColumnOrder(nameColumn, amountColumn);

The Grid comes up with the correct contents, however:

  1. The grid is very plain (no rows or columns, no grid header etc.)
  2. The rows are not selectable

![A screenshot of the grid]
(https://farm1.staticflickr.com/863/41720276521_ef3c7fa43b_b.jpg)

The examples in the documentation for vaadin 8, like e.g. [Grid]
(https://vaadin.com/docs/v8/framework/components/components-grid.html) have no particular styling, so I assume that the sceenshots show the default look for grids…?

So what’s the problem with my grid? Can the problem be caused by TouchKit?

Thanks!

  • Steinar

The problem was that I exposed the servlet as a Servlet service instead of a VaadinServlet service.

Ie. I had

@Component(
    property= {
        HttpWhiteboardConstants.HTTP_WHITEBOARD_SERVLET_PATTERN+"=/*",
        HttpWhiteboardConstants.HTTP_WHITEBOARD_CONTEXT_SELECT + "=(" + HttpWhiteboardConstants.HTTP_WHITEBOARD_CONTEXT_NAME +"=ukelonn)",
        HttpWhiteboardConstants.HTTP_WHITEBOARD_SERVLET_NAME+"=ukelonn"},
    service=Servlet.class,
    immediate=true
)
public class UkelonnServlet extends TouchKitServlet {
    ...
}

and changed it to this, and then the tables started looking good and the same did a lot of other components:

@Component(
    property= {
        HttpWhiteboardConstants.HTTP_WHITEBOARD_SERVLET_PATTERN+"=/*",
        HttpWhiteboardConstants.HTTP_WHITEBOARD_CONTEXT_SELECT + "=(" + HttpWhiteboardConstants.HTTP_WHITEBOARD_CONTEXT_NAME +"=ukelonn)",
        HttpWhiteboardConstants.HTTP_WHITEBOARD_SERVLET_NAME+"=ukelonn"},
    service=VaadinServlet.class,
    immediate=true
)
public class UkelonnServlet extends TouchKitServlet {
    ...
}

Note also that I need to use the “valo” theme for the grids to look good.

All other themes (ie. the legacy themes, and the “touchkit” theme) makes the grids look more or less like the screenshot in the first posting of the thread.