Link available in browse screen?

Hello team,

I’m looking for information on how to make a field on the browse screen available as a link, so the user can click on it directly and not have to open the entry and copy the link to go to it. I haven’t found a way to do this in searching, but of course my search terms could be poor.

Thanks!,
Adam

1 Like

Hi.

Can you explain in detail what you want to get as a result?

For example, you have a field link in your entity with text “https://google.com” and you want to click on this link in the browser table and open Google start page.

Regards,
Nadezhda.

Hello Nadezhda,

Yes, that’s pretty much the expected functionality.

Thanks,
Adam

You should create component Link for each link in your table.

Here is an example how it could be implemented with adding extra column:

    @Inject
    private GroupTable<NewEntity> newEntitiesTable;
    @Inject
    private UiComponents uiComponents;

    @Subscribe
    public void onBeforeShow(BeforeShowEvent event) {
        newEntitiesTable.addGeneratedColumn("buttonColumn", newEntity ->{
            Link link = uiComponents.create(Link.class);
            link.setUrl(newEntity.getUrl());
            link.setCaption(newEntity.getCaption());
            return link;
        });
    }

As a result in runtime it looks like this:

Pay attention to your URL, it should be an absolute.

More information about Link.

Regards,
Nadezhda.

Thank you very much for the example and information!