Create link column fields in table

Hi,

Is there a way to create a column with linking fields to another edit screen? As far as I can see, there isn’t a way to create a column without the id of a field in the current Entity. I need to have a preview link which opens another edit screen of another Entity. This is what I tried so far.
image

In the preview screen in the InteliJ I can see that there are previews:
image

But when the application is started the preview fields are lost.
image

How can I link another screen to the current using table and columns?
P.S A button option in the column could work too, but I can’t manage to find a way to create that either.

Thanks in advance!

Hi Mikaela,

Use a generated column. In its column generator handler you can create a LinkButton or any other component, something like this:

<column id="preview" caption="Preview"/>
    @Install(to = "usersTable.preview", subject = "columnGenerator")
    private Component usersTablePreviewColumnGenerator(User user) {
        LinkButton linkButton = uiComponents.create(LinkButton.class);
        linkButton.setCaption("Preview");
        linkButton.addClickListener(clickEvent -> {
            screenBuilders.editor(User.class, this)
                    .withScreenClass(UserEdit.class)
                    .withOpenMode(OpenMode.DIALOG)
                    .editEntity(user)
                    .show();
        });
        return linkButton;
    }
1 Like

Hi Konstantin Krivopustov,

I am getting problem for creating the link as from above code seems older version v1 ,
Now I am trying to do like this in listing page
image
Could any one have Idea to add this link in listing page to show.

Hey,
Is there another way to create a column with linking fields to show in the list.xm file as the above code may be version from version1 and the id not being added in the column as for now ?