Important Notice - Forums is archived
To simplify things and help our users to be more productive, we have archived the current forum and focus our efforts on helping developers on Stack Overflow. You can post new questions on Stack Overflow or join our Discord channel.

Vaadin lets you build secure, UX-first PWAs entirely in Java.
Free ebook & tutorial.
Column Generation Help
I have a predloaded table that already contains a number of rows of data. I am trying to add a column to the beginning of this table that will contain a button for each of the table. The key here is that this column of buttons is not actually part of the data, but just part of the table. I believe that the way to do this is to use a generatedColumn.
I have the following table defined:
private Table<SpaceSummary> table = new Table<>(SpaceSummary.class)
.withProperties("id", "name", "title", "primaryOwner", "secondaryOwner", "phoneNumber", "status", "birthDay")
.withColumnHeaders("id", "Space Key", "Title", "Primary Owner", "Secondary Owner", "Pages", "Status", "Creation Date")
.setSortableProperties("name", "email")
.withFullWidth();
[color=#64635a] [/color]
I was trying to add the generated column with the following way:
public class ActionColumnGenerator implements Table.ColumnGenerator
{
public Component generateCell(Table source, Object itemId, Object columnId)
{
final Button generatedCell = new Button("Column Test");
return generatedCell;
}
}
And the step below is how I add the generated column to my table, which does not work.
table.addGeneratedColumn("Action", new ActionColumnGenerator());
If anyone can provide any help that would be much appreicated. I apologize if this is an obvious answer, I am new to vaadin! :)
- Sachin Jain
Have you tried to call refreshRowCache after adding the new column? https://vaadin.com/api/com/vaadin/ui/Table.html#refreshRowCache()