vaadin8

How to enter timestamp in Vaadin 8

ぐ巨炮叔叔 提交于 2020-02-25 03:03:10
问题 I am trying to enter timestamp using DateTimeField but in my entity i am having java.sql.timestamp . Converting datetimefield to timestamp is giving error ConversionClass package com.vaadin.convertor; import java.sql.Timestamp; import java.time.LocalDateTime; import com.vaadin.data.Converter; import com.vaadin.data.Result; import com.vaadin.data.ValueContext; @SuppressWarnings("serial") public class StringTimestampConvertor implements Converter<LocalDateTime, Timestamp> { @SuppressWarnings(

Java, Vaadin 8, lazy loading with grid

情到浓时终转凉″ 提交于 2020-01-25 21:35:27
问题 I am trying to implement lazy loading with Grid in Vaadin 8. But it only shows an empty table. What do I do wrong? Also, how do I set the number of items to load (limit) to for example 20 items (the default is 40 items)? private Grid<Image> makeLazyTable() { Grid<Image> grid = new Grid<Image>(); DataProvider<Image, Void> dataProvider = DataProvider.fromCallbacks( query -> { int offset = query.getOffset(); int limit = query.getLimit(); OffsetRequest request = new OffsetRequest(); request

Java, Vaadin 8, lazy loading with grid

狂风中的少年 提交于 2020-01-25 21:35:09
问题 I am trying to implement lazy loading with Grid in Vaadin 8. But it only shows an empty table. What do I do wrong? Also, how do I set the number of items to load (limit) to for example 20 items (the default is 40 items)? private Grid<Image> makeLazyTable() { Grid<Image> grid = new Grid<Image>(); DataProvider<Image, Void> dataProvider = DataProvider.fromCallbacks( query -> { int offset = query.getOffset(); int limit = query.getLimit(); OffsetRequest request = new OffsetRequest(); request

Unable to process file module-info.class within a Java9 project results in ClassFormatException

蓝咒 提交于 2020-01-20 07:00:21
问题 Trying to Run Vaadin 8.1 app under Java 9 prerelease in IntelliJ 2017.2.2 I was able to build a vaadinjavanine.war using a fresh project and host the same using Jetty Server. I ended up trying to deploy the generated war to a tomcat server. But, during the startup of the tomcat server, I am getting the following exception: 21-Aug-2017 22:53:38.830 SEVERE [localhost-startStop-1] org.apache.catalina.startup.ContextConfig.processAnnotationsFile Unable to process file [/Library/Tomcat/apache

Updating the page view after closing the modal window (Vaadin 8)

房东的猫 提交于 2020-01-16 08:38:10
问题 I use Vaadin version 8.9.3. I need to show a modal window when I click a button. In this window, the user enters the information, clicks on the button, the information is saved and displayed in a table in the main window. Main page: Modal page: To display the modal window I use BrowserWindowOpener. In order not to overload the question, I will give only a small piece of code. The FormLayout in which there is TextField("uid"), Grid and Button("Создать") - DeviceForm: private

@UIScope annotation not respected for spring view?

不打扰是莪最后的温柔 提交于 2020-01-14 19:50:29
问题 I am facing an issue with the Vaadin spring annotation @UIScope , defined as follows: @SpringComponent @SpringView(name = AdminView.VIEW_NAME) @UIScope public class AdminView extends NavigatingView { ... } The view is created every time the navigation is opening the view. I would expect that it is created only once, on first time access. However, if I replace @UIScope with @Scope(UIScopeImpl.VAADIN_UI_SCOPE_NAME) then it works as expected. Did I miss something? 回答1: It's related to the order

How to dismiss Vaadin 8 confirmation dialog while performing lengthy operation

扶醉桌前 提交于 2020-01-06 03:56:31
问题 I have Vaadin 8 confirmation code there it performs a long lasting task. I would like to dismiss the dialog and show a progress bar:- ConfirmDialog.show(UI.getCurrent(), "Dynamic Report warning caption", "More than " +rows+ " rows in this table. It will take long time to generate this report.\nDo you still want to continue? ", SalkkuTM.getI18N("PortfolioManagementMenuBar.deleteData.confirmDialog.yes.caption"), SalkkuTM.getI18N("PortfolioManagementMenuBar.deleteData.confirmDialog.no.caption"),

How to set multiple levels in a tree grid with Vaadin 8.1?

泄露秘密 提交于 2020-01-05 04:43:06
问题 I need to display three levels in a vaadin tree grid. I use the 'setItems' method to set values to the tree grid as per the vaadin documentation. How can I set a third nested level to the grid. TreeGrid<Project> treeGrid = new TreeGrid<>(); treeGrid.setItems(getProjects(), Project::getSubProjects); treeGrid.addColumn(Project::getName).setCaption("Name"); treeGrid.addColumn(Project::getStatus).setCaption("Status"); I've followed the code snippet in the vaadin 8.1 documentation https://vaadin

Preventing Clickjacking attack by Vaadin

浪子不回头ぞ 提交于 2020-01-04 02:19:06
问题 I want to prevent clickjacking attack in Vaadin 7 and 8 apps. As Vaadin applications are by default designed to be embeddable, some configuration or code is needed to add safety. Here's my first experiment, which adds X-Frame-Options header to each response to force browser to use same origin policy. public class MyVaadinServlet extends VaadinServlet { @Override protected void service(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { // add

Vaadin 8 : reload grid with data from server every 1min

谁说我不能喝 提交于 2019-12-30 06:56:16
问题 I am trying to have a auto refresh feature for the grid which basically, updates the grid with latest data from the server every 'n' seconds. I was able to implement the PollListner whenever the user enables Auto-Refresh. UI ui= TestUI.getCurrent(); Boolean value = isRefreshChkBox.getValue(); PollListener listener = e -> { explorer.reloadUI(); }; if (value) { String refreshRateValue = refreshRateTxtField.getValue(); int refreshRate = Integer.valueOf(refreshRateValue); int millis = (int)