vaadin

Vaadin JPAContainer JDBC Connection Usage

为君一笑 提交于 2019-12-19 04:07:00
问题 Once one JPAContainer is created like JPAContainer users = JPAContainerFactory.make(User.class, "persistenceUnitName"); Now I suppose that the "users" container will use one EntityManager which in turn uses one JDBC connection from the connection pool. That resource utilization (jdbc Connection attached to EntityManager attached to JPAContainer) happens during the lifetime of the httprequest or the usage of the entityManager/connection has another lifespan ? Can you please help me understand

Vaadin open link in new tab

喜你入骨 提交于 2019-12-18 14:50:03
问题 I have the following piece of code that I wrote using Vaadin. The code opens the page www.google.com when the user clicks the button. My question is is there any way for me to specify that the page is to be opened in a new tab? Thanks. button.addClickListener(new Button.ClickListener() { public void buttonClick(ClickEvent event) { getUI().getPage().setLocation("http://www.google.com"); } }); 回答1: getUI().getPage().open("http://www.google.com", "_blank"); The _blank window name is important

Vaadin: Update UI after data returned

柔情痞子 提交于 2019-12-18 09:32:19
问题 @SpringUI public class VaadinUI extends UI { ... String sql = "SELECT * FROM table1"; button.addClickListener(e -> layout.addComponent(new Label(service.evalSql(sql)))); ... Currently, when button is pressed, the page waits for evalSql() to get a result back from the database before adding a new Label. How can I change this so, when button is pressed, a new Label is immediately added, set to an initial placeholder string ("Fetching result..") but updated to the result string after the

Update Grid with a fresh set of data, in Vaadin 7.4 app

依然范特西╮ 提交于 2019-12-18 08:39:34
问题 In the new Vaadin 7.4 release, the new Grid widget debuted as an alternative to the venerable Table. After getting a Grid displayed, I later want to replace the entire set of data with fresh data. Rather than update the individual rows, I want to simply replace them. I happen to be using a BeanItemContainer for easy read-only display of some objects with JavaBeans-style getter methods. 回答1: I considered two approaches: Two step process of replacing bean items. (1) First remove all BeanItem

VAADIN cannot find themes when in productionMode

半腔热情 提交于 2019-12-17 16:30:51
问题 I have custom theme for my VAADIN application in src/main/webapp/VAADIN/themes/mytheme/ with files mytheme.scss and styles.scss. Everything works fine when the vaadin productionMode deployment parameter is set to false in web.xml. When I set the parameter to true, suddenly Vaadin cannot find the resources for my theme and keeps complaining with: Requested resource [/VAADIN/themes/mytheme/styles.css] not found from filesystem or through class loader. Add widgetset and/or theme JAR to your

VAADIN cannot find themes when in productionMode

醉酒当歌 提交于 2019-12-17 16:28:53
问题 I have custom theme for my VAADIN application in src/main/webapp/VAADIN/themes/mytheme/ with files mytheme.scss and styles.scss. Everything works fine when the vaadin productionMode deployment parameter is set to false in web.xml. When I set the parameter to true, suddenly Vaadin cannot find the resources for my theme and keeps complaining with: Requested resource [/VAADIN/themes/mytheme/styles.css] not found from filesystem or through class loader. Add widgetset and/or theme JAR to your

How to refresh the vaadin Grid after you change something?

。_饼干妹妹 提交于 2019-12-14 03:04:39
问题 I have a Vaadin grid that I use. I make a put request to update the scores of the elements in the grid. I was wondering how to make the grid respond after the update to show the new information. Right now I have to refresh the entire page to show the new information. I'm not sure what code I would post, I'm using a basic vaadin grid if that helps. 回答1: I am not completely sure with what you mean by putting changes to the grid, but I suppose you are using setItems or a data provider? For the

How to update Vaadin Grid after push?

痞子三分冷 提交于 2019-12-14 03:04:37
问题 I'm trying to update a grid in Vaadin after a change has been made to the grid from a different UI instance. To elaborate, I have two different UI instances, UI1 and UI2 (tabs from two different browsers). These UI instances contain a view which contains a grid consisted of Contact objects that have various properties such as name, age, gender... I add a Contact to the grid from UI1 and I want UI2 to see the updated grid instantly without having to refresh. To accomplish that, I know I have

Integrate spring-boot-starter-security with Vaadin 7

≡放荡痞女 提交于 2019-12-14 02:32:48
问题 I'm trying to integrating Spring Security with Vaadin Spring (https://vaadin.com/wiki/-/wiki/Main/Vaadin+Spring). My application class just starts up the Spring Application https://gist.github.com/anonymous/c047030c61b90c02d1ef I created a class that extends WebSecurityConfigurerAdapter https://gist.github.com/anonymous/0e905d0627adf5e2dc39 pom.xml includes the dependency spring-boot-starter-security When I type in localhost:8080 it redirects me to the login url (http://localhost:8080/login)

Vaadin + Spring Integration: Null Pointer exception

旧街凉风 提交于 2019-12-13 21:07:36
问题 I have a Vaadin web application with UI class like this: @SuppressWarnings("serial") @Theme("mytheme") public class LogsUI extends UI { LogsView logsViewer = new LogsView(); @WebServlet(value = "/*", asyncSupported = true) @VaadinServletConfiguration(productionMode = false, ui = LogsUI.class) public static class Servlet extends VaadinServlet { } @Override protected void init(VaadinRequest request) { Panel panel = new Panel(); panel.setContent(logsViewer); panel.setSizeFull(); setContent(panel