vaadin

Updating data in Vaadin's grid

烈酒焚心 提交于 2019-12-11 16:49:54
问题 Hello everyone my problem is that my grid doesn't update data. I've a Thread that get new values from a database but when I assign the new DataProvider from the collection that get new values, the grid doesn't change anything. For example, the Grid contains the orders from clients, every 30 seconds a Thread search if there are new orders available, then y get all the orders in an ArrayList and set the new ArrayList in the grid’s DataProvider but the Grid continues having the same values as

How to make UI receive scroll events

家住魔仙堡 提交于 2019-12-11 15:48:23
问题 In my vaadin application I need to implement a fixed header, that changes size depending on the scroll position of the UI. While there are geters for scroll position in Vaadin 8, there seems to be no functionallity implemented to listen for scroll events. So I tried to implement a JavaScript connector, that just informs the server-side UI, that the user has scrolled, so the server-side UI can then notify the Header as a scrollListener. So far thats what I planned, but I just can't find out,

Run code in Vaadin 8 application idependent of UI

╄→尐↘猪︶ㄣ 提交于 2019-12-11 15:23:51
问题 In earlier versions, you could have a class which implements ServletContextListener and put your code in the contextInitialized method, so that it runs when the server starts. This is useful for loading up the database into memory. How does one achieve this in a Vaadin 8 project? 回答1: In exactly the same way: By registering a ServletContextListener . You can use the @WebListener annotation for this. For example: public class WebConfig { @WebServlet("/*") @VaadinServletConfiguration(ui =

Vaadin Multilanguage portlet component captions

百般思念 提交于 2019-12-11 15:15:55
问题 I'm developing portlets with Vaadin in a Liferay Portal , mostly with english component captions(names) like "Cancel" "back" "next" and so on. Now i have to make the portlets "Multilanguage ready" that means if an user has set the language of his Liferay page to english he should see my portlet captions in english , but if an user sets the language of his Liferay page to german, the portlet captions should be displayed in german. Is there a way to check wich language the user has set as his

Vaadin 7 : How to update Cookie value?

偶尔善良 提交于 2019-12-11 14:37:00
问题 Methods for cookie management these I use as below public static Cookie getCookieByName(final String name) { // Fetch all cookies from the request Cookie[] cookies = VaadinService.getCurrentRequest().getCookies(); // Iterate to find cookie by its name for (Cookie cookie : cookies) { if (name.equals(cookie.getName())) { return cookie; } } return null; } public static Cookie createCookie(final String name, final String value, final int maxAge) { // Create a new cookie Cookie cookie = new Cookie

How to merge cells in Vaadin grid

孤街醉人 提交于 2019-12-11 13:38:36
问题 I wonder how I can merge in Vaadin 7.6 a group of cells for the same column name, where values in the cells would be replaced by a unique cell. Right now, I only found how to merge headers and footers. Tks, 回答1: Unfortunately Vaadin Grid doesn't support that. As you noticed it's possible to merge cells on headers and footers but it's not supported on the actual content cells. 来源: https://stackoverflow.com/questions/34884375/how-to-merge-cells-in-vaadin-grid

Vaadin using multiple context menus

社会主义新天地 提交于 2019-12-11 13:28:30
问题 Im trying to create a Table with Vaadin where you have different options in the context menu depending on if you have selected a single row or multiple rows. It took me a while to do this but now i have a working solution. The problem is that is feel that its not good coding practice and I would gladly take any advice in how to perhaps split my "function" into smaller classes or functions. Could I perhaps create a standalone Action class?. Feel free to comment and advice and please do note

How to run hazelcast session replication using vaadin4spring?

感情迁移 提交于 2019-12-11 12:52:40
问题 I am writing a simple demo application using hazelcast session replication based on the shared security example mentioned in here https://github.com/peholmst/vaadin4spring. The problem is that if i am starting the application it stays on the login site with "communication error". With vaadin debug on, it shows me "Response didn't contain a server id. Please verify that the server is up-to-date and that the response data has not been modified in transmission." In the IDE no stack trace is

vaadin with ajax

*爱你&永不变心* 提交于 2019-12-11 12:48:39
问题 Can any one help me How to send Portletrequest to vaadin from javascript as a AJAX call? I have a requirement to display the selected value from javaScript in vaadin portlet popup window I'm Using AJAX call to get the selected value . But Ajax sends HTTP request so my portlet context is vanished . Can any one help me how to portletrequest My Ajax Call from JavaScript: $.ajax( { type : "POST", url : "serveResource", data : {"tBPMNObject": JSON.stringify(chart.series.name)}, dataType : "json" }

How to add MenuItem's to a MenuBar in Vaadin Declarative UI?

喜你入骨 提交于 2019-12-11 11:58:40
问题 The MenuItem components are not added to the MenuBar: <v-menu-bar _id="menu" width="100%" /> <v-menu-item caption="Option 1"/> <v-menu-item caption="Option 2"/> </v-menu-bar>--> 回答1: Found this MenuBarDeclarativeTest which suggests that items should be defined with just "menu". String design = "<vaadin-menu-bar auto-open='' tabindex=5>" + "<menu checkable=''>Save</menu>" + "<menu description='Open a file'>Open</menu>" + "<menu disabled=''>Close</menu>" + "<menu icon='http://foo.bar/ico.png'