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:
[code]
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;
}
[/code]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!