Important Notice - Forums is archived
To simplify things and help our users to be more productive, we have archived the current forum and focus our efforts on helping developers on Stack Overflow. You can post new questions on Stack Overflow or join our Discord channel.

Vaadin lets you build secure, UX-first PWAs entirely in Java.
Free ebook & tutorial.
Table ActionHandler weird behaviour
I have a Problem with a ActionHandler on a Table with a ContainerDataSource (BeanItemContainer).
I want to check a property in the selected Item, as I implemented like this:
resultTable.addActionHandler(new Action.Handler() {
@Override
public Action[] getActions(Object target, Object sender) {
if( sender instanceof TypedTable ) {
TypedTable<Kontotransaktion> source = (TypedTable<Kontotransaktion>) sender;
if( source.getValue() != null ) {
if( ((BeanItem<Kontotransaktion>) source.getContainerDataSource().getItem(source.getValue())).getBean() instanceof Kontotransaktion ) {
Kontotransaktion currentTransaction = ((BeanItem<Kontotransaktion>) source.getContainerDataSource().getItem(source.getValue())).getBean();
if(currentTransaction.getBuchungsReferenz() != null) {
//Booking referenced
return new Action[] {zeigeBuchung};
} else {
//No booking referenced
return new Action[] {verknuepfen, neueBuchung};
}
}
}
}
return null;
}
When I now right-click a Item in the Table, nothing happens. (Not even the ActionHandler#getActions() method gets called)
But if you select a Item by left-clicking it and right-clicking somewhere in the whitespace in the table - you can actually see the correct Action Items.
So basically the problem is that as it seems the actionhandler doesn't get triggered by right clicking a Item in a ContainerDataSource in the table.
Any similar cases known?
Any suggestions are appreciated!