Vaadin Cell of column behave as a link

I have a table in Vaadin that display data depending on the data type selected in a Tree. For URL type data it shows a row (two columns) URL and the actual URL in the other but is displayed as plain text. I would like that URL to be clickable and opened in another window.

I tried adding a Link to that case but it displays something like com.vaadin.ui.Link@596bf9 instead of the actual link. Here’s the code I use:

xincoTable.addItem(new Object[]{header, header.equals("URL") ? new Link(value,
                                new ExternalResource(value)) : value}, i++);

value has the actual URL string. I saw the tutorial but it uses generated columns so I’m not sure on how to pull it out. I guess part of the issue is that the behavior is desired for only that cell in that case, it’ll be text in all other cases and of course there are other stuff in that columns in other rows as well.

Also asked

Any idea?

Hi Javier,

take a look to the
related pages of vaadin book, more exactly to the point “Components Inside a Table”, there is an example of how to implement the behaviour you want to.

Hope this helps.


That’s the example I refer to. Sadly it uses generated columns. I got the response in stackoverflow:

I have an IndexedContainer which holds multiple links. That container is passed to a GeneratedPropertyContainer, which generates a property dynamically. The ​GeneratedPropertyContainer is the container for my Grid. When displayed, the links are displayed as .toString() representation of links. Here is my code.

CssLayout linksLayout = new CssLayout();
Link link0 = new Link(“Click Me”, new ExternalResource(“”));
Link link1 = new Link(“Google”, new ExternalResource(“”));
Link link2 = new Link(“Facebook”, new ExternalResource(“”));
Link link3 = new Link(“Cricbuzz”, new ExternalResource(“”));

    IndexedContainer links = new IndexedContainer();
    links.addContainerProperty("links", Link.class, null);
    Item newItem1 = links.getItem(links.addItem());
    Item newItem2 = links.getItem(links.addItem());
    Item newItem3 = links.getItem(links.addItem());
    Item newItem4 = links.getItem(links.addItem());
    GeneratedPropertyContainer linkContainer = new GeneratedPropertyContainer(links);
    Grid linkGrid = new Grid(linkContainer);
    linkContainer.addGeneratedProperty("delete", new PropertyValueGenerator<String>() {
        public String getValue(Item item, Object itemId, Object propertyId) {
            return "Delete";
        public Class<String> getType() {
            return String.class;
    linkGrid.getColumn("delete").setRenderer(new ButtonRenderer(e -> 

[/code]Here is the output.