Loading...
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.

Product icon
TUTORIAL

Vaadin lets you build secure, UX-first PWAs entirely in Java.
Free ebook & tutorial.

Why Vaadin does not select rows on right click in Grid?

Yuriy Artamonov
5 years ago Apr 27, 2016 10:06am
Guttorm Vik
5 years ago Apr 27, 2016 12:13pm

Looking at our source, we do:

contextMenu.addGridBodyContextMenuListener(this)

public void onContextMenuOpen(GridContextMenuOpenEvent event) {

    // If clicking outside of current selection, set selection to clicked row.
    Object itemId = event.getItemId();
    boolean rowIsSelected = itemId!=null && grid.isSelected(itemId);
    ...
    // optionally rebuild menu based on selection

}
Yuriy Artamonov
5 years ago Apr 27, 2016 2:15pm