Show content in empty table

Hi,

Is there any possiblity to show content in an empty table? So something like this:
image
Buttons and stuff would not be necessary but the option to show a hint to the user would be very nice.

I could imagine adding specific controls in case the table is empty but that would be a lot of work and cumbersome.

Regards,
-b

Hi @b.tel!

Since 7.2.0.BETA1+ we have similar functionality, see cuba-platform/cuba#1984.

We can specify a message and a link message with a handler when Table or DataGrid does not have data.

For instacne,

<groupTable id="projectsTable"
            emptyStateMessage="There is no data in table"
            emptyStateLinkMessage="Click here to create new record"
            dataContainer="projectsDc">
@Inject
private ScreenBuilders screenBuilders;

@Install(to = "projectsTable", subject = "emptyStateLinkClickHandler")
private void projectsTableEmptyStateLinkClickHandler(Table.EmptyStateClickEvent<Project> emptyStateClickEvent) {
    screenBuilders.editor(emptyStateClickEvent.getSource())
            .newEntity()
            .show();
}

image

1 Like

That’s great - wasn’t aware of that.