I can't get a grid context menu to show. Vaadin 7.6.3, vaadin-context-menu 0.7.4.
GridContextMenu gridContextMenu = new GridContextMenu(grid);
gridContextMenu.addGridBodyContextMenuListener(e -> eventGridRowContext(e));
And the handler:
private void eventGridRowContext(GridContextMenuOpenEvent e)
{
Job job = (Job) e.getItemId();
if(job == null)
{
return;
}
grid.select(job);
ContextMenu contextMenu = e.getContextMenu();
contextMenu.removeItems();
contextMenu.addItem("Test", e2 -> Notification.show("Test"));
contextMenu.open(e.getX(), e.getY());
}
I'm getting the event. Debugger runs right through the open call, but nothing happens.
If you're using a custom add-on which includes widgets then you're not able to use the precompiled widgetset as the add-on widgetset needs to be compiled into the application widgets.
The Vaadin Addons documentation states...
"Most add-ons include widgets, client-side counterparts of the server-side components used in the Vaadin Java API, as illustrated in Role of the widget set. The widget set needs to be compiled into the application widget set."
This article and this thread suggest that you need to recompile the widgetset for the vaadin-context-menu add-on to work.