converting table to grid

We use a lot of tables in our website ( Vaadin Table ), but our customer just told us that they want to be able to edit inside the table. Now, I know that is possible in Table ( I already got that to work ), but I sort of like the edit mechanism for Grid better. Is there an easy way to convert Vaadin Table to Vaadin Grid? Since Grid is not a drop in replacement, I know it will take some conversion work. Just wondering how hard people have found it, and if there is any documentation out there on doing such a conversion.

Here is our normal table usage:

public final class ReplenishmentOrderMgmtView extends VerticalLayout implements View {

private final Table table;
private static final String[] DEFAULT_COLLAPSIBLE = {
"carrier", "carrierService", "trackingNumber"
private static final Object[] VISIBLE_COLUMNS = {
private static final String[] COLUMN_NAMES = {
"Contact User",
"First Name",
"Last Name",
"PO Number",
"Replenishment Order Id",
"Cell Id",
"Cell Name",
"Supplier Id",
"Supplier Name",
"Resized Bin Qty",
"Expected On Dock Date",
"Ship Quantity",
"Received Qty",
"Last Receipt Date",
"Carrier Service",
"Tracking Number",
"Creation Date"

private Table buildTable() {
    final Table table = new Table();


    updateList( table );
    table.setColumnHeaders( COLUMN_NAMES );

    // Allow dragging items to the reports menu

// table.setDragMode(TableDragMode.MULTIROW);

    table.addActionHandler(new ReplenishmentOrdersActionHandler());
    table.addValueChangeListener(event -> this.selectItemFromTable());

    return table;

[/code]There is also some binding involved in there - my data source is a java bean. Obviously, I am only includine code that will impact the table itself. Any advice or opinions would be much appreciated.

As you are aware there are API differences between Table and Grid, so conversion requires some manual work. The data model in both are the same, so if you used BeanItemContainer with Table, you can use it with Grid too. However some API shortcuts are not present in Grid, but you can use Container API’s directly.

The notable difference is that in Table you can place Components in cells and if you have done that extensively in your application, those need to be replaced with Widget Renderers. You can find some basic Renderes in core framework. In our directory there are some additional ones (e.g.!addon/grid-renderers-collection-for-vaadin7
) and you can use those as study material to learn how to create your own ones if needed.

Edit functionality is quite different in Grid. There are actually many ways to edit data. You can use integrated row editor or the unbuffered mode cell editor. Grid Renderers can be used for columnar edit mode. Fourth alternative is to create inline forms in Grid Details Generator. Alternatively Grid Details Generator is good for showing additional data items, which helps you to reduce visible column count and adds performance.

If you need to add row specific actions, my favourite way to do that is to use Context Menu add-on, which you can also find in the Directory (!addon/vaadin-contextmenu

Sometimes you need to re-map some of the use cases. Currently Grid for example does not have drag’n’drop feature for rows. On the other hand Grid has lot of new features, like column grouping. The client widget itself is more modern and renders much faster in new browsers.