Table Cell Link

I want to be able to have a link in a cell that does some action with the row entity. e.g. send an email.

Invoice ID ---  View Invoice --- Send Invoice
1     Invoice.pdf    Email Invoice

In my example I have a list of invoices and I want to be able to send an email reminder to that person by clicking a cell on the table. Can’t quite figure out how to do this.

I managed to get it to generate a button in the cell but can’t figure out how to add an action.

Hope this makes sense.

I think i am getting somewhere:

public Component cellGenerator(Invoice entity) {

        WebButton webButton = new WebButton();
        webButton.setCaption("Email Invoice");
		return webButton;

I am wondering how to put an action to each button that remembers what invoice the button is sending.

Have added a pic to show what I want



Managed to resolve by reading various docs.

Here is what I managed to figure out:

    public void init(Map<String, Object> params) {
        invoicesTable.addGeneratedColumn("Email Invoice", new Table.ColumnGenerator() {
            public Component generateCell(Entity entity) {

                  WebButton field = (WebButton) componentsFactory.createComponent(WebButton.NAME);
                field.setCaption("Send Email");
               field.setAction(new BaseAction("hello") {
                    public void actionPerform(Component component) {
                return field;


You can improve your solution:

protected Table<User> usersTable;
usersTable.addGeneratedColumn("Email Invoice", entity -> {
    LinkButton field = componentsFactory.createComponent(LinkButton.class);
    field.setCaption("Send Email");
    field.setAction(new BaseAction("hello")
            .withHandler(event -> {
    return field;

Inject Table with Entity type and use createComponent with class of a Component. Also, BaseAction has a couple of convenient methods, for instance with lambda handler.

1 Like