vaadin 8 + spring自定义小部件集 [英] vaadin 8 + spring custom widgetset
问题描述
我正在尝试使用spring + vaadin引导类来使客户端组件正常工作.
i am trying to get working client-side component with class with spring+vaadin boot.
问题可能出在自定义小部件集中.项目应放在哪里?靠近客户端组件?资源(在资源中无法编译)
The problem is probably in custom widgetset. Where should be placed in project? close to client component? Resouces (cant compile while in resources)
但是我的客户端组件未调用onStateChange.我尝试过一切,但我无法处理.
But my client component is not getting called onStateChange. I have tryed everyting but i cant handle it.
gwt package {
client {
connector extended by AbstractExtensionConnector with @Connect directivy
ClientSide class with java
}
AppWidgetset.gwt.xml
}
impl
{
server {
Class with AbstractExtension
}
}
pom.xml
<plugin>
<groupId>com.vaadin</groupId>
<artifactId>vaadin-maven-plugin</artifactId>
<version>${vaadin.plugin.version}</version>
<configuration>
<extraJvmArgs>-Xmx1G -Xss1G</extraJvmArgs>
<webappDirectory>${basedir}/target/classes/VAADIN/widgetsets</webappDirectory>
<hostedWebapp>${basedir}/target/classes/VAADIN/widgetsets</hostedWebapp>
<noServer>true</noServer>
<persistentunitcachedir>${basedir}/target/tmp/gwt-unitCache</persistentunitcachedir>
<compileReport>true</compileReport>
<strict>true</strict>
</configuration>
<executions>
<execution>
<goals>
<goal>update-theme</goal>
<goal>update-widgetset</goal>
<goal>compile
</goal> <!-- Comment out compile-theme goal to use on-the-fly theme
compilation -->
<goal>compile-theme</goal>
</goals>enter code here
</execution>
</executions>
</plugin>
推荐答案
您将 WidgetSet.gwt.xml
文件放在src/main/resources中与小部件类匹配的文件夹中.
You place WidgetSet.gwt.xml
file in src/main/resources in folder that matches your widget class.
如果我有小部件
src/main/java/com/m1kah/vaadinapp/mywidget/MyWidget.java
然后我的小部件集文件将位于此位置
Then my widgetset file would be in this location
src/main/resources/com/m1kah/vaadinapp/mywidget/Widgetset.gwl.xml
CSS样式和其他公共"文件位于文件夹public中的相同资源路径中.
CSS styles and other "public" files are in same resources path in folder public.
这篇关于vaadin 8 + spring自定义小部件集的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!