Hello,
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:
[code]
public final class ReplenishmentOrderMgmtView extends VerticalLayout implements View {
private final Table table;
private static final String[] DEFAULT_COLLAPSIBLE = {
"contactFirstName",
"contactLastName",
"supplierName",
"carrier", "carrierService", "trackingNumber"
};
private static final Object[] VISIBLE_COLUMNS = {
"barcode",
"contactUserId",
"contactFirstName",
"contactLastName",
"PO",
"orderId",
"cellId",
"cellName",
"wmsItem",
"description",
"supplierId",
"supplierName",
"statusDesc",
"resizedBinQty",
"expectedOnDockDate",
"shipQuantity",
"receivedQty",
"lastReceiptDate",
"carrier",
"carrierService",
"trackingNumber",
"creationDate"
};
private static final String[] COLUMN_NAMES = {
"Barcode",
"Contact User",
"First Name",
"Last Name",
"PO Number",
"Replenishment Order Id",
"Cell Id",
"Cell Name",
"Part",
"Description",
"Supplier Id",
"Supplier Name",
"Status",
"Resized Bin Qty",
"Expected On Dock Date",
"Ship Quantity",
"Received Qty",
"Last Receipt Date",
"Carrier",
"Carrier Service",
"Tracking Number",
"Creation Date"
};
private Table buildTable() {
final Table table = new Table();
table.setSizeFull();
table.addStyleName(ValoTheme.TABLE_BORDERLESS);
table.addStyleName(ValoTheme.TABLE_NO_HORIZONTAL_LINES);
table.addStyleName(ValoTheme.TABLE_COMPACT);
table.setSelectable(true);
table.setColumnCollapsingAllowed(true);
table.setColumnReorderingAllowed(true);
updateList( table );
table.setSortContainerPropertyId("creationDate");
table.setSortAscending(true);
table.setColumnHeaders( COLUMN_NAMES );
// Allow dragging items to the reports menu
// table.setDragMode(TableDragMode.MULTIROW);
table.setMultiSelect(false);
table.addActionHandler(new ReplenishmentOrdersActionHandler());
table.addValueChangeListener(event -> this.selectItemFromTable());
table.setImmediate(true);
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.