GroupTable - Can I get selected column of a cell?

Hi,
I’m trying to get the selected column when user clicks on a row or uses shortcut.
I’ve tried:
groupTable.getColumn(id).addClickListener(event -> { System.out.println(“COLUMN CLICKED”);} //subscribe to AfterShow event
But it doesn’t work. Is there any way to work around this case? Thanks.

Hello!

Could you clarify what version of CUBA do you use? I’ve tried the following code on 7.2.14 and it works:

@Inject
private Notifications notifications;
@Inject
private GroupTable<Order> ordersTable;

@Subscribe
public void onInit(InitEvent event) {
    ordersTable.getColumn("name").addClickListener(orderClickEvent -> {
        notifications.create(Notifications.NotificationType.HUMANIZED)
                .withCaption(orderClickEvent.getSource().getIdString())
                .show();
    });
}

Note that you also can use the following code entry:

@Subscribe("ordersTable.name")
public void onOrdersTableNameClick(Table.Column.ClickEvent<Order> event) {
    notifications.create(Notifications.NotificationType.HUMANIZED)
            .withCaption(event.getSource().getIdString())
            .show();
}

Hello Roman,
Thanks for your reply. I’m sorry I forgot to indicate that I’m actually using jmix 1.0.0-211. Both solutions provided do not work. Should I ask this question on the jmix forum instead?
Thanks.