vaadin-grid

How to have a click on component in a grid cell in Vaadin 8 Grid to select cells row?

隐身守侯 提交于 2021-01-28 03:49:22
问题 When clicking a cell in a Vaadin 8 Grid that contains component like VerticalLayout row does not get selected (using Vaadin 8.1.5). If the component does not fill the whole cell then clicking the unused area in cell makes the row selected. I have been researching how could the click on component be forwarded to the cell click listener but have not get any grip yet on that. Guess it is even not the best way to do it. What would be the solution? 回答1: I provide my own current solution as an

Vaadin 14 - grid disappearing when using nested layout

社会主义新天地 提交于 2020-04-16 05:47:12
问题 After implementing nested layouts i faced the problem with rendering component containing grid. The analysis shows that is present in html but it has display-block attributes and the grid is never visible. I read the similar question (Vaadin 14 - Grid not Displaying/Populating When Used in Nested Layout) but the suggestions listed there brought me no result. Here comes my code: MainLayout.kt: @Theme(value = Material::class, variant = Material.DARK) class MainLayout : Composite<Div>(),

how to export to csv/excel using vaadin grids?

泪湿孤枕 提交于 2020-04-11 06:45:34
问题 In Vaadin 14+, I'm creating grids and would like the users to have a stable/easy way to export the grid's contents to csv or, preferablly, Excel. To do so, I was surprised that Vaadin does not appear to provide this functionality, and so one has to use 3rd party developer plugins (such as https://vaadin.com/directory/component/exporter/overview). However, these plugins have numerous bugs (eg can't export grids with date values correctly to Excel etc.). Is there a recommended approach in

Vaadin Grid : How to use bean with LocalTime field in line-based editor?

前提是你 提交于 2020-02-24 10:09:06
问题 When I try to use a line-based editor (setEditorEnabled(true), Buffered Mode), I get an error: Caused by: com.vaadin.data.util.converter.Converter$ConversionException: Unable to convert value of type java.time.LocalTime to presentation type class java.lang.String. No converter is set and the types are not compatible. at com.vaadin.data.util.converter.ConverterUtil.convertFromModel(ConverterUtil.java:116) ~[vaadin-server-7.6.8.jar:7.6.8] Grid initialization: BeanItemContainer<MealTo> container

Vaadin Grid : How to use bean with LocalTime field in line-based editor?

流过昼夜 提交于 2020-02-24 10:04:08
问题 When I try to use a line-based editor (setEditorEnabled(true), Buffered Mode), I get an error: Caused by: com.vaadin.data.util.converter.Converter$ConversionException: Unable to convert value of type java.time.LocalTime to presentation type class java.lang.String. No converter is set and the types are not compatible. at com.vaadin.data.util.converter.ConverterUtil.convertFromModel(ConverterUtil.java:116) ~[vaadin-server-7.6.8.jar:7.6.8] Grid initialization: BeanItemContainer<MealTo> container

Couldn't capture double click event using vaadin 7

て烟熏妆下的殇ゞ 提交于 2020-02-04 04:51:25
问题 I'm learning Vaadin framework. I'm trying to capture double click event for the item click listener. But it's not working as expected. Please refer the code below, grid.addItemClickListener(e -> { if(e.isDoubleClick()) { System.out.println("Double click"); } else { System.out.println("Single click"); } }); When I do double click on the grid item, it is only considered a single click. 回答1: As mentioned in Doubleclick listener on Vaadin Grid the problem is the setEditorEnabled(true) as this

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

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

How can I see details to grid in Vaadin flow?

穿精又带淫゛_ 提交于 2020-01-06 08:00:29
问题 In my Vaadin flow project, I have a grid and I set some items but it shows like grid data items I want a decent format that a user can see specific details not like. Any idea or is there any component in vaadin to make this pretty? 回答1: There are two options to do that: provide a better ValueProvider than the .toString() , that is used in your property right now. E.g. grid.addColumn(person -> Integer.toString(person.getYearOfBirth())) .setHeader("Year of birth"); TemplateRenderer : You can