Closed beirtipol closed 6 years ago
FYI, I originally posted this on the 'framework' project and got a bit further, but not sure if relevant:
It looks like 'ContextMenuConnector.init()' is never called. If I manually try and invoke the 'ContextMenuConnector' to get it to initialize, I get this error:
java.lang.ClassNotFoundException: com.vaadin.client.extensions.AbstractExtensionConnector
So, I added vaadin-client to my pom and then I got this error:
java.lang.UnsatisfiedLinkError: com.google.gwt.core.client.JavaScriptObject.createObject()Lcom/google/gwt/core/client/JavaScriptObject;
at com.google.gwt.core.client.JavaScriptObject.createObject(Native Method) ~[gwt-user-2.8.1.jar:na]
at com.vaadin.client.FastStringMap.create(FastStringMap.java:72) ~[vaadin-client-8.1.2.jar:8.1.2]
at com.vaadin.client.ui.AbstractConnector.<init>(AbstractConnector.java:78) ~[vaadin-client-8.1.2.jar:8.1.2]
at com.vaadin.client.extensions.AbstractExtensionConnector.<init>(AbstractExtensionConnector.java:28) ~[vaadin-client-8.1.2.jar:8.1.2]
at com.vaadin.contextmenu.client.ContextMenuConnector.<init>(ContextMenuConnector.java:25) ~[vaadin-context-menu-2.0.0.jar:2.0.0]
I've dropped the reference to the ContextMenuConnector, but I'm still not clear how the RPC call is supposed to get registered so that the 'showConextMenu' actually gets invoked
Hi @beirtipol,
Have you compiled a custom widgetset for your application? The ContextMenu add-on contains some client-side modifications that need to be compiled in the project to bring in the client-side of the ContextMenu.
Hi @tsuoanttila
I see a file 'DemoWidgetSet.gwt.xml' in my theme folder. I think this was created when I originally tried to set it up.
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE module PUBLIC "-//Google Inc.//DTD Google Web Toolkit 2.5.1//EN" "http://google-web-toolkit.googlecode.com/svn/tags/2.5.1/distro-source/core/src/gwt-module.dtd">
<module>
<!--
This file is automatically updated based on new dependencies by the
goal "vaadin:update-widgetset".
-->
<!-- Inherit add-on widgetset -->
<!--
Uncomment the following to compile the widgetset for one browser only.
Multiple browsers can be specified as a comma separated list. The
supported user agents at the moment of writing were:
ie8,ie9,gecko1_8,safari,opera
The value gecko1_8 is used for Firefox and safari is used for webkit
based browsers including Google Chrome.
-->
<!-- <set-property name="user.agent" value="safari"/> -->
<!--
To enable SuperDevMode, uncomment this line.
See https://vaadin.com/wiki/-/wiki/Main/Using%20SuperDevMode for more
information and instructions.
-->
<!-- <set-configuration-property name="devModeRedirectEnabled" value="true" /> -->
<inherits name="com.vaadin.DefaultWidgetSet" />
<inherits name="com.vaadin.contextmenu.WidgetSet" />
<inherits name="org.vaadin.gridutil.WidgetSet" />
</module>
I'm using maven in my project. It's configured as:
<plugin>
<groupId>com.vaadin</groupId>
<artifactId>vaadin-maven-plugin</artifactId>
<executions>
<execution>
<goals>
<goal>clean</goal>
<goal>resources</goal>
<goal>update-theme</goal>
<goal>update-widgetset</goal>
<goal>compile-theme</goal>
<goal>compile</goal>
</goals>
</execution>
</executions>
</plugin>
And is the DemoWidgetSet
used in the UI with @Widgetset
annotation?
You should remove the vaadin-client
dependency as it is only be needed for the widgetset compilation and it should be automatically downloaded by the maven plug-in upon compile
. Said dependency contains a bunch of transitive dependencies to GWT that sometimes cause problems with the Spring (Boot).
About the main question of how RPCs are registered and called etc, is that when you add the ContextMenu add-on to a component, it will register it as an extension to the component and initialise the client-side connector with the client-side RPCs. When the server calls for getRpcProxy()
it gets a proxy of the client-side RPC API and calling a method of that will send the information of
as JSON to the client, and continue processing it in the users browser.
Thanks for the info on the RPCs. Makes a bit more sense now.
I added a @Widgetset("DemoWidgetSet") as suggested to my main 'UI' class. It barfs on startup with
2018-03-19 13:05:13.845 INFO 12820 --- [o-10000-exec-10] com.vaadin.server.VaadinServlet : Requested resource [/VAADIN/widgetsets/DemoWidgetSet/DemoWidgetSet.nocache.js] not found from filesystem or through class loader. Add widgetset and/or theme JAR to your classpath or add files to WebContent/VAADIN folder.
I have a custom theme implemented for some basic styling. I can see the widget set file in the same location as my theme: src/main/webapp/VAADIN/themes/mytheme/DemoWidgetSet.gwt.xml
Not sure which tutorial I was following when I tried to set up the context-menu before. Do I actually need to have this 'DemoWidgetSet' file at all or should the dependency on below be enough?
<dependency>
<groupId>com.vaadin</groupId>
<artifactId>vaadin-context-menu</artifactId>
</dependency>
The problem is not related to ContextMenu, you just do not have your widgetset compiled. DemoWidgetSet.gwt.xml should not be in a theme folder.
There are two options - to have DemoWidgetSet.gwt.xml in resources or not having it at all, and using vaadin plugin widgetset auto-detection feature.
For more information, please refer to https://vaadin.com/docs/v8/framework/addons/addons-maven.html#addons.maven
I close the ticket as not a bug
Hi Elmot, I have the same issue, I normally use the ContextMenu for all my vaadin projects, but for this one, where the only change made was use springboot, it didn't work.
This is the error I'm getting, I can confirm that I have compiled my widget set well and my Widget Set is well set up.
Error on debug http:localhost:8080?debug
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.Lg(http://localhost:8080/?debug) at Unknown.vYd(http://localhost:8080/?debug) at Unknown.UQb(http://localhost:8080/?debug) at Unknown.WQb(http://localhost:8080/?debug) at Unknown.VQb(http://localhost:8080/?debug) at Unknown.dQb(http://localhost:8080/?debug) at Unknown.cQb(http://localhost:8080/?debug) at Unknown.LPb(http://localhost:8080/?debug) at Unknown.MPb(http://localhost:8080/?debug) at Unknown.QRb(http://localhost:8080/?debug) at Unknown.Xv(http://localhost:8080/?debug) at Unknown.jw(http://localhost:8080/?debug) at Unknown.onreadystatechange<(http://localhost:8080/?debug) at Unknown.$h(http://localhost:8080/?debug) at Unknown.bi(http://localhost:8080/?debug) at Unknown.ai/<(http://localhost:8080/?debug) at Unknown.anonymous(Unknown) Caused by: com.vaadin.client.metadata.NoDataException: There are no parameter type data for com.vaadin.contextmenu.client.ContextMenuClientRpc.showContextMenu at Unknown.Ig(http://localhost:8080/?debug) at Unknown.xzc(http://localhost:8080/?debug) at Unknown.lAc(http://localhost:8080/?debug) at Unknown.UQb(http://localhost:8080/?debug) at Unknown.WQb(http://localhost:8080/?debug) at Unknown.VQb(http://localhost:8080/?debug) at Unknown.dQb(http://localhost:8080/?debug) at Unknown.cQb(http://localhost:8080/?debug) at Unknown.LPb(http://localhost:8080/?debug) at Unknown.MPb(http://localhost:8080/?debug) at Unknown.QRb(http://localhost:8080/?debug) at Unknown.Xv(http://localhost:8080/?debug) at Unknown.jw(http://localhost:8080/?debug) at Unknown.onreadystatechange<(http://localhost:8080/?debug) at Unknown.$h(http://localhost:8080/?debug) at Unknown.bi(http://localhost:8080/?debug) at Unknown.ai/<(http://localhost:8080/?debug) at Unknown.anonymous(Unknown)
Hi Elmot, I have the same issue, I normally use the ContextMenu for all my vaadin projects, but for this one, where the only change made was use springboot, it didn't work.
This is the error I'm getting, I can confirm that I have compiled my widget set well and my Widget Set is well set up.
Error on debug http:localhost:8080?debug
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.Lg(http://localhost:8080/?debug) at Unknown.vYd(http://localhost:8080/?debug) at Unknown.UQb(http://localhost:8080/?debug) at Unknown.WQb(http://localhost:8080/?debug) at Unknown.VQb(http://localhost:8080/?debug) at Unknown.dQb(http://localhost:8080/?debug) at Unknown.cQb(http://localhost:8080/?debug) at Unknown.LPb(http://localhost:8080/?debug) at Unknown.MPb(http://localhost:8080/?debug) at Unknown.QRb(http://localhost:8080/?debug) at Unknown.Xv(http://localhost:8080/?debug) at Unknown.jw(http://localhost:8080/?debug) at Unknown.onreadystatechange<(http://localhost:8080/?debug) at Unknown.$h(http://localhost:8080/?debug) at Unknown.bi(http://localhost:8080/?debug) at Unknown.ai/<(http://localhost:8080/?debug) at Unknown.anonymous(Unknown) Caused by: com.vaadin.client.metadata.NoDataException: There are no parameter type data for com.vaadin.contextmenu.client.ContextMenuClientRpc.showContextMenu at Unknown.Ig(http://localhost:8080/?debug) at Unknown.xzc(http://localhost:8080/?debug) at Unknown.lAc(http://localhost:8080/?debug) at Unknown.UQb(http://localhost:8080/?debug) at Unknown.WQb(http://localhost:8080/?debug) at Unknown.VQb(http://localhost:8080/?debug) at Unknown.dQb(http://localhost:8080/?debug) at Unknown.cQb(http://localhost:8080/?debug) at Unknown.LPb(http://localhost:8080/?debug) at Unknown.MPb(http://localhost:8080/?debug) at Unknown.QRb(http://localhost:8080/?debug) at Unknown.Xv(http://localhost:8080/?debug) at Unknown.jw(http://localhost:8080/?debug) at Unknown.onreadystatechange<(http://localhost:8080/?debug) at Unknown.$h(http://localhost:8080/?debug) at Unknown.bi(http://localhost:8080/?debug) at Unknown.ai/<(http://localhost:8080/?debug) at Unknown.anonymous(Unknown)
Hi, I had the same issue. Try adding this to pom.xml
<plugin>
<groupId>com.vaadin</groupId>
<artifactId>vaadin-maven-plugin</artifactId>
<version>${vaadin.version}</version>
<configuration>
<extraJvmArgs>-Xmx512M -Xss1024k</extraJvmArgs>
<webappDirectory>${basedir}/src/main/webapp/VAADIN/widgetsets</webappDirectory>
<hostedWebapp>${basedir}/src/main/webapp/VAADIN/widgetsets</hostedWebapp>
<noServer>true</noServer>
<persistentunitcachedir>${basedir}/target/tmp/gwt-unitCache</persistentunitcachedir>
<compileReport>true</compileReport>
<strict>true</strict>
</configuration>
<executions>
<execution>
<configuration>
<!-- if you don't specify any modules, the plugin will find them -->
</configuration>
<goals>
<goal>resources</goal>
<goal>update-widgetset</goal>
<goal>compile</goal>
</goals>
</execution>
</executions>
</plugin>
Using versions: Spring Boot, Vaadin 8.1.2, ContextMenu 2.0.0
I can't seem to get the ContextMenu to open. I can debug through the right click event until I get to 'GridContextMenu.open(int x, int y). The call in to the proxy to 'showContextMenu' doesn't seem to do anything.
I have the same issue on the demo project and can't get contextmenus to open on any component. I'm not clear if I've missed out on some resource file configuration or if the code below should be enough.