vaadin

update vaadin grid when new record added to database

只愿长相守 提交于 2019-12-08 03:22:30
I want to add the element to the table in the database and update the grid with new data (probably I should add records directly on UI to the table but whatever). My grid component looks like this @SpringComponent public class PlayersGrid extends Grid<Player> { @PostConstruct public void afterInit() { addColumn(Player::getId).setHeader("ID"); addColumn(Player::getName).setHeader("Name"); addColumn(Player::getCharacterClass).setHeader("Class"); addColumn(Player::getLevel).setHeader("Level"); } public class GridContentObserver implements ContentObserver { @Override public void refreshContent() {

Vaadin std prod project includes vaadin-client-compiler and jetty?

二次信任 提交于 2019-12-08 03:15:34
问题 I get vaadin-client-compiler artifact (which brings Jetty with it) included with my production project. Am I supposed to ? To reproduce I'm starting from scratch and letting Maven generate a Vaadin multimodule project for me: mvn -DarchetypeGroupId=com.vaadin -DarchetypeArtifactId=vaadin-archetype-application-multimodule -DarchetypeVersion=7.6.2 -DarchetypeRepository=http://repo.maven.apache.org/maven2/ -DgroupId=com.acme -DartifactId=VaadinTest1 -Dversion=1.0.0-SNAPSHOT -Dpackage=com.acme

Vaadin Valo page will not scroll

一笑奈何 提交于 2019-12-08 02:02:05
问题 I'm creating a new Vaadin theme based on the native Valo theme. After the upgrade to Vaadin 7.3 Valo (done by someone else) the page content won't scroll anymore. All of the other elements on the page where overflow property is applied, work fine except the whole page itself. I know I could apply this .v-ui > .v-widget { overflow: visible; } which would be an 'ok' solution. But it's not what would normally be seen after an upgrade. What could be causing such behavior? At the moment no

Vaadin+Spring (without SpringBoot) with JavaConfig

旧城冷巷雨未停 提交于 2019-12-07 23:15:35
问题 i'm trying to combine vaadin with spring (without spring-boot) and java-annotation based configuration for the spring part. The autowiring seems to work on the vaadin-ui part but not in "custom-ui classes" (e.g. "public class LoginScreen extends CustomComponent"). I'm getting an NPE or a null-object on SysOut. Further i noticed that "@ComponentScan(basePackages={"net.myapp"})" is not scanning for beans. The only way to declare beans is in the CustomConfiguration itself. XML-Configuration is

Retrieve mysql table comment using DatabaseMetaData

浪子不回头ぞ 提交于 2019-12-07 22:03:45
问题 So I'm using Vaadin Java web framework for a project which requires the ability to edit the table. Vaadin provides a way to get Connection object from SimpleJDBCConnectionPool (Here's the API) From the Connection I can get DatabaseMetaData object. And I have the following code: private List<String> getTableNames(DatabaseMetaData md) throws SQLException { ArrayList<String> tables = new ArrayList<String>(); ResultSet rs = md.getTables(null, null, "", null); while (rs.next()) { tables.add(rs

How to integrate Vaadin 7 with OSGi?

百般思念 提交于 2019-12-07 17:58:39
问题 I want to integrate vaadin 7 with osgi but there is no longer any AbstractApplicationServlet class. I've followed the integration using the vaadin bridge by Neil Bartlett https://github.com/njbartlett/VaadinOSGi. I've tried using the VaadinServlet somehow but with no luck. I've also searched for other solutions but found none. Do you have any suggestions? Thanks 回答1: Vaadin 7 has a lot of design changes that are not visible for default use cases, but especially for OSGi integration you have

Vaadin 简单集合 GWT示例

筅森魡賤 提交于 2019-12-07 17:07:41
Vaadin 是一个基于GWT的框架,其中各种add-on,还可以与Spring等集成,但是当用户数量达到一定程度,或者需要提高反应速度,则要使用Vaadin进行Client端的开发了,因为Vaadin的自身组件会频繁的与服务端交互(甚至一个按钮的点击),有时候我们仅仅想要一个样式变换的效果,希望直接在Client端(即浏览器)进行,我们就需要用GWT进行Vaadin 的Client端开发。 而Vaadin的许多组件add-on(纯客户端的也可以叫widget)都是使用这种方式开发 首先,widget的开发必须遵循如下结构(图来自Vaain官网,由Ying Li大大完全翻译了的官方教程!!链接: https://vaadin.com/book/zh/-/page/gwt.html#figure.gwt.overview.project )。 而我所做的简单Demo结果如下: MyComponentWidget.java 这是一个GWT类,继承一个GWT的Button,其中类中定义了一个ComponentListener的内部接口,是为了在连接器(MyComponentConnector.java)中实现Widget中的事件传到连接器中。 package component.client; import com.google.gwt.event.dom.client

vaadin ---用maven创建vaadin 的工程

时间秒杀一切 提交于 2019-12-07 17:07:29
使用maven 命令创建vaadin 工程: mvn archetype:generate -DarchetypeGroupId=com.vaadin -DarchetypeArtifactId=vaadin-archetype-clean -DarchetypeVersion=LATEST -DgroupId=your.company -DartifactId=project-name -Dversion=1.0 -Dpackaging=war 我的eclipse 里已经安装了m2eclipse 插件,所以使用该工具创建一个这样的maven工程: 生成的工程: 原pom 中已经有了jetty 服务器支持,但tomcat 习惯了,加上tomcat 热部署支持: 到tomcat的安装目录中apache-tomcat-6.0.24\conf在其中增加一个用户定义,默认是没有用户的,结果如下: <tomcat-users> <user username="admin" password="password" roles="manager"/> </tomcat-users> 在maven的setting.xml中定义本机的tomcat: <servers> <server> <id>tomcat</id> <username>admin</username> <password

Vaadin AbstractJavaScriptComponent: prevent browser javascript caching [duplicate]

久未见 提交于 2019-12-07 16:21:22
问题 This question already has answers here : Vaadin @Javascript : clear cache for updated JS file (4 answers) Closed 3 years ago . I have a custom javascript component in my vaadin application which extends AbstractJavaScriptComponent . @JavaScript({"javaScriptConnector.js", "MyComp.js", "MyCompHtml.js"}) public class MyComp extends AbstractJavaScriptComponent { ..... ..... } Whenever I do a change to MyComp.js , I need to clear my browser cache to see the change. This is ok when I develop the

Vaadin's vaadinBoootstrap.js

蓝咒 提交于 2019-12-07 16:14:59
问题 I meet confusing issue! I'm using Vaadin(7) framework to create some (quiet simple) app. When I'm testing it in Eclipse, everything works fine. But when i deploy my project into Tomcat, some mysteries starts... When I "run" the application from Manager App, there is just the message: Failed to load the bootstrap javascript: ./VAADIN/vaadinBootstrap.js But when I type the same address to the browser (Firefox) manually, it works fine again. I've done a little investigation about that and I