I tried this, and it works, with two issues:
1. you need to remove the existing instance of the column. Unlike regular DOM elements (and therefore Widgets), which can only be in one place at a time, the cells generate a rendered string, which will be a new snippet of HTML, which will be result in new DOM element. And, apparently, nothing the table logic is policing the number of times a given column can appear, so the column will exist in two locations: the original location pushed one to the right if the insert position was before it, and the new location.
2. With a DatePickerCell, the first time I changed the date via the "popup", nothing happened in the table, but the column updater did get invoked, and refreshing the document, or just paging forward and back again, showed me that the update had taken, and I saw the new data. Subsequent edits to cells in that column did reflect immediately in the table.
Code snippet:
private CellTable<Customer> ct = new CellTable<Customer>(pageRows);
// later, as the last column in the table:
Column<Customer, Date> expiresColumn =
new Column<Customer, Date>(
new DatePickerCell(DateTimeFormat.getMediumDateFormat())) {
@Override
public Date getValue(Customer cust) {
return cust.getExpiration();
}
};
expiresColumn.setFieldUpdater(new FieldUpdater<Customer, Date>() {
@Override
public void update(int index, Customer cust, Date value) {
cust.setExpiration(value);
custUpdater.updateCustomer(cust);
}
});
TextHeader expiresHeader = new TextHeader("Expiration");
ct.addColumn(expiresColumn, expiresHeader);
// after finishing table setup, and adding everything to the Root Panel
int colIndex = ct.getColumnIndex(expiresColumn);
Column<Customer, ?> col = ct.getColumn(colIndex);
ct.removeColumn(expiresColumn);
ct.insertColumn(0, col, expiresHeader);