Don't work context menu

Hi, everyone!

Context menu doesn’t work in grid. It doesn’t display. I click right button over grid but nothing happen, context menu is invisible. My snippet of code:

    GridContextMenu<MyClass> contextMenu  = new GridContextMenu<>(grid);

    // handle item right-click
    contextMenu.addGridBodyContextMenuListener(event -> {
        contextMenu.addItem("Info", VaadinIcons.INFO, selectedMenuItem -> {
            Notification.show("Right-clicked item ");
        });
    });

If you start application with ?debug url parameter do you see any client side exceptions? One thing that pops into my mind, is that you have not recompiled and the context menu client part is missing, hence no menu shows up.

Tatu Lund:
If you start application with ?debug url parameter do you see any client side exceptions? One thing that pops into my mind, is that you have not recompiled and the context menu client part is missing, hence no menu shows up.

Thanks for reply.

You are right I have exceptions.
When I run application this exception appears:
Widgetset 'com.vaadin.DefaultWidgetSet' does not contain an implementation for com.vaadin.contextmenu.GridContextMenu. Check the connector's @Connect mapping, the widgetset's GWT module description file and re-compile your widgetset. In case you have downloaded a vaadin add-on package, you might want to refer to <a href='http://vaadin.com/using-addons'>add-on instructions</a>.
When I right click on grid this exception appears:
Error performing server to client RPC calls java.lang.IllegalStateException: There is no information about com.vaadin.contextmenu.client.ContextMenuClientRpc.showContextMenu. Did you remember to compile the right widgetset? at Unknown.Hg(com.vaadin.DefaultWidgetSet-0.js) at Unknown.new iVd(com.vaadin.DefaultWidgetSet-0.js) at Unknown.bQb(com.vaadin.DefaultWidgetSet-0.js) at Unknown.dQb(com.vaadin.DefaultWidgetSet-0.js) at Unknown.cQb(com.vaadin.DefaultWidgetSet-0.js) at Unknown.mPb(com.vaadin.DefaultWidgetSet-0.js) at Unknown.lPb(com.vaadin.DefaultWidgetSet-0.js) at Unknown.UOb(com.vaadin.DefaultWidgetSet-0.js) at Unknown.VOb(com.vaadin.DefaultWidgetSet-0.js) at Unknown.ZQb(com.vaadin.DefaultWidgetSet-0.js) at Unknown.Sv(com.vaadin.DefaultWidgetSet-0.js) at Unknown.dw(com.vaadin.DefaultWidgetSet-0.js) at Unknown.eval(com.vaadin.DefaultWidgetSet-0.js) at Unknown.Wh(com.vaadin.DefaultWidgetSet-0.js) at Unknown.Zh(com.vaadin.DefaultWidgetSet-0.js) at Unknown.eval(com.vaadin.DefaultWidgetSet-0.js) Caused by: com.vaadin.client.metadata.NoDataException: There are no parameter type data for com.vaadin.contextmenu.client.ContextMenuClientRpc.showContextMenu at Unknown.Eg(com.vaadin.DefaultWidgetSet-0.js) at Unknown.new gyc(com.vaadin.DefaultWidgetSet-0.js) at Unknown.Wyc(com.vaadin.DefaultWidgetSet-0.js) at Unknown.bQb(com.vaadin.DefaultWidgetSet-0.js) at Unknown.dQb(com.vaadin.DefaultWidgetSet-0.js) at Unknown.cQb(com.vaadin.DefaultWidgetSet-0.js) at Unknown.mPb(com.vaadin.DefaultWidgetSet-0.js) at Unknown.lPb(com.vaadin.DefaultWidgetSet-0.js) at Unknown.UOb(com.vaadin.DefaultWidgetSet-0.js) at Unknown.VOb(com.vaadin.DefaultWidgetSet-0.js) at Unknown.ZQb(com.vaadin.DefaultWidgetSet-0.js) at Unknown.Sv(com.vaadin.DefaultWidgetSet-0.js) at Unknown.dw(com.vaadin.DefaultWidgetSet-0.js) at Unknown.eval(com.vaadin.DefaultWidgetSet-0.js) at Unknown.Wh(com.vaadin.DefaultWidgetSet-0.js) at Unknown.Zh(com.vaadin.DefaultWidgetSet-0.js) at Unknown.eval(com.vaadin.DefaultWidgetSet-0.js)

But I copied

<dependency>
   <groupId>com.vaadin</groupId>
   <artifactId>vaadin-context-menu</artifactId>
   <version>2.1.0</version>
</dependency>

<repository>
   <id>vaadin-addons</id>
   <url>http://maven.vaadin.com/vaadin-addons</url>
</repository>

to my Maven pom.xml, as describe in https://vaadin.com/directory/component/vaadin-contextmenu.

What’s wrong?

Have you recompiled the widgetset? And added it to your .gwt.xml widgetset file (com.vaadin.contextmenu.WidgetSet according to the readme)?

Sorry for fool question but how can I recompile a widgetset in IntelliJ IDEA ? Unfortunately, i have zero experience with it.

I resolve the task. Need to add in pom.xml a few lines:
in build/plugins/goals
<goal>update-widgetset</goal>
in configuration
<webappDirectory> ${basedir}/src/main/resources/VAADIN/widgetsets </webappDirectory>
in includes
<include>widgetsets/**/*</include>

In IDEA terminal run command: mvn package

Tatu and Erik, thanks for replies!