vaadin8

Vaadin DateField saves null value to database

岁酱吖の 提交于 2019-12-12 16:47:48
问题 I'm using VAADIN 8 and struggling with a problem. I've bind all fields on FormLayout and want to save values ​​from these fields in a db. All fields are filled with values. The essence of the problem is that the DateField value is sent as null when the object is saved to the database The question is why DateFiled has null value and how to win the problem? VAADIN v.8.6.2 Entity (simplified): @Entity @DynamicInsert @DynamicUpdate @Table(name = "Orders") public class Order{ @Id @GeneratedValue

Is there a way to set a cell in grid in edit mode with Vaadin 8 grid

梦想的初衷 提交于 2019-12-12 03:53:59
问题 I have defined a grid like this using Vaadin 8: ListDataProvider<Value> gridDataProvider = new ListDataProvider<>(new ArrayList<>()); GridSelectionModel<Value> selectionModel; Grid<Value> grid = new Grid<>(Value.class); TextField editorField = new TextField(); editorField.setSizeFull(); Binder<Value> binder = new Binder<>(); binder.bind(editorField, Value::getValue, Value::setValue); Editor<Value> gridEditor = grid.getEditor(); gridEditor.setBinder(binder); gridEditor.addSaveListener(

Use filtered dataProvider contents when FileDownloader is called in Vaadin

帅比萌擦擦* 提交于 2019-12-11 18:34:25
问题 I'm trying to download a csv file after applying filters to the DataProvider. For some reason the filtered results are shown in the Grid, but the downloaded csv file still contains all data. @AutoView class FinancialTransactionsView : VerticalLayout(), View { private val grid: Grid<FinancialTransaction> private val yearField: ComboBox<Int> private val dataProvider = DataProvider.ofCollection(FinancialTransaction.findAll()) private val fileDownloader: FileDownloader init { label("Financial

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-8 ComboBox click has no effect

夙愿已清 提交于 2019-12-11 07:29:37
问题 I have a ComboBox in my Vaadin 8 code. allAtts here is a Set of Attendant -s, and the field theAtt in there is of type String : private ComboBox<Attendant> theCB = new ComboBox<Attendant>(null,allAtts); theCB.setEmptySelectionAllowed(false); Binder<SearchArgs> binder = new Binder<SearchArgs>(SearchArgs.class); binder.setBean(sas); binder.forField(theCB).bind("theAtt"); .. VerticalLayout vl = new VerticalLayout(theCB, rb, deleteBtn); What's more - this exact flow of theCB is a copy-paste from

How to determine if a DateField is valid in Vaadin 8

允我心安 提交于 2019-12-11 07:00:01
问题 I have: DateField dateField = new DateField("Date"); Button submitButton = new Button("Submit"); submitButton.addClickListener(click -> handleClickListener()); where in handleClickListener() I want to prevent a submit if there is a validation error in the DateField . I know I can use a Binder and then binder.validate() but this form has no backing object and I just want a simple form. How can I do something like: if(!dateField.isValid()) // no further processing else // process I can't find

Liferay 7 and Vaadin 8: Vaadin Shared is not active

自作多情 提交于 2019-12-11 06:58:17
问题 I'm try to install a module with a vaadin portlet. When the bundle started throws the following exception. Does any one knows how to check if Vaadin Liferay Integration is active? or my module needs to activate atuomatically? thanks 2018-08-30 17:45:07.745 INFO [Refresh Thread: Equinox Container: b06cd3dd-72ac-0018-1cb3-ebc69224d879][BundleStartStopLogger:35] STARTED com.smart.services.vaadin.test_1.0.0.SNAPSHOT [979] 2018-08-30 17:45:07.755 ERROR [Refresh Thread: Equinox Container: b06cd3dd

How to add a generated column to Vaadin 8 Grid?

落爺英雄遲暮 提交于 2019-12-09 18:16:37
问题 Looks like GeneratedPropertyContainer does not exist in Vaadin 8. How can we add a generated column to Vaadin 8 Grid? I appreciate if you can provide an example. 回答1: If you pass the bean class to the constructure of Grid then it will add all properties as columns to the grid. If you want to only have some properties as columns then don't pass the class to the constructor and add your columns manually like this: grid.addColumn(Address::getStreet); grid.addColumn(Address::getHouseNumber); grid

How to find the offset value of the Polygon from center on Openlayers

巧了我就是萌 提交于 2019-12-08 07:02:41
问题 i calculated the (x1,Y1) and (x2,Y2) and calculated the difference between them (Blue line ) and gave those pixel values to driver to click but i am not able to click on the polygon (Point). 1.First the mouse will go to center of the map where (x1,y1)=(960,520) according to the window but the driver will consider those values as (0,0). 2. Now i need to calculate the offset values from center to each polygon on the map.(x1,y1)=(960,520) and (x2,y2)=(1000,232) the difference between the (x1,y1)