vaadin10

Vaadin Flow Grid. How get the data/rows from grid

孤者浪人 提交于 2021-02-08 10:12:53
问题 i use Grid with DataProvider and lazy loading to load the data into the grid. How can i get the data from grid after the data was loaded? I mean, i need get a data from grid that already have a data. i need something like grid.get.... thx. 回答1: I would use grid.getDataCommunicator().fetchFromProvider(..) which returns stream of items method for this, see API spec here: https://demo.vaadin.com/javadoc/com.vaadin/vaadin-core/10.0.2/com/vaadin/flow/data/provider/DataCommunicator.html

Understanding Vaadin Flow / Vaadin 10

淺唱寂寞╮ 提交于 2020-05-10 14:58:06
问题 preamble: I'm an advanced Vaadin developer (I've used 6, 7, and now all my project are migrated to Vaadin 8). I'm starting to study Vaadin 10 / Flow, but I find myself in some hot waters. What I'm actually struggling with is the "project" itself. The more I deep into, the more I feel like this framework is moving into a css / html based framework, which requires more css/html knowledge than java. What I mean is that if you don't perfectly know how css and html works, you can't use this

how to handle SSO redirect in Vaadin 14

夙愿已清 提交于 2020-04-16 05:45:48
问题 We have a Vaadin 14 (Flow) application which is fronted by an Apache reverse proxy that integrates with Gluu for authentication. When the session is not valid anymore, either because of session timeout or a logout in another browser tab/window, the Apache server will send a redirect to the Gluu server to let the user log in again. However when this happens for an internal Vaadin XHR call (Ajax request), Vaadin does not seem to handle this response very well, and shows an "Invalid JSON

Vaadin onbeforeunload event

左心房为你撑大大i 提交于 2020-02-24 05:53:26
问题 Is there any Out Of the Box Vaadin 10 (and higher) event similar to window.onbeforeunload in JavaScript? I've tried to use onDetach() or beforeLeave(), but it only works inside UI, and when user reloads the page or closes the page it's not working. 回答1: You can use the approach described in https://vaadin.com/forum/thread/17523194/unsaved-changes-detect-page-exit-or-reload that was already suggested in a comment. At the same time, I'd urge you to be really careful with beforeunload events

How to use a css grid in Vaadin Flow as replacement for Framework 8's GridLayout?

强颜欢笑 提交于 2020-02-21 13:04:22
问题 I'm trying to migrate an existing Vaadin 8 application to Vaadin 12 and need to know how to recreate the functionality of Vaadin 8's GridLayout in Vaadin 12. According to Vaadin Docs a GridLayout can be replaced in Vaadin 12 by: "Use Div together with the new CSS Grid functionality that is supported in most browsers" Unfortunately it's not totally clear how exactly this can be done. Lets assume that I have a Vaadin composite "HelloGrid" : @StyleSheet("styles/hello-grid.css") public class

How to change style of combo box in Vaadin 10

牧云@^-^@ 提交于 2019-12-30 14:46:35
问题 I would like to adapt a combo box component's CSS. The combo box has my style class custom1 added which should disable border radius for left corners. In my shared-styles.html , I tried to adapt CSS properties: .custom1 { --lumo-border-radius: 0px; } This is changing the styles but it is not exactly what I want. According to docs, I should follow this wiki to apply local scope styles for the web component. So, I tried: <custom-style> <style> ... </style> </custom-style> <dom-module id="my

Vaadin Flow download code works for Chrome but not for Firefox - How can I support both?

匆匆过客 提交于 2019-12-25 01:13:26
问题 I have the following code to download a file from Vaadin Flow (12.0.7). exportBtn.addClickListener(e -> { toDownload = FileUtil.getLatestExport(); (toDownload != null) { StreamResource resource = new StreamResource(toDownload.getName(), () -> FileUtil.getInputStreamForFile(toDownload)); Element object = new Element("object"); object.setAttribute("download", true); object.setAttribute("data", resource); Input name = new Input(); UI.getCurrent().getElement().appendChild(name.getElement(),

Vaadin 10/11 and embedded Jetty

旧巷老猫 提交于 2019-12-21 20:10:05
问题 I developed middle-size application on Vaadin 8.5.1. Jetty embedded 9.4.8 was used as Servlet container for Vaadin servlet. In Java code i initialize Jetty instance, create Vaadin servlet and attach it to Jetty. In Maven i use 'vaadin-maven-plugin' which helps me make correct settings to folders, also packaging is 'jar'. The Spring (not Spring Boot) are used for application configuration purposes and IoC. Now i want to migrate project to Vaadin 10/11. I was tried all Vaadin Starter Packs

MenuBar widget in Vaadin Flow (Vaadin 10) missing?

故事扮演 提交于 2019-12-20 01:43:22
问题 Vaadin Framework (Vaadin 8) offers a MenuBar widget, as discussed in the manual, and shown in the Sampler. When I switch the manual to "Vaadin 10" mode, I cannot find the MenuBar widget. I know Vaadin 10 (Vaadin Flow) is a major re-write of Vaadin, is the widget changed in name or not yet available? 回答1: Possibly in Vaadin 14 Update: A MenuBar widget is planned for development by Vaadin Ltd, scheduled for Vaadin 14 release. See the manual. On GitHub, see Issue # 4694 MenuBar component. No

Vaadin flow: grid conditional background color

戏子无情 提交于 2019-12-13 02:51:10
问题 I want to color grid lines, depending on a condition. I try this: Java: gridEtudiant.setClassNameGenerator(t -> { if (t.getEtud_numero().startsWith("2")) { return "error_row"; } return ""; }); Css: td.error_row { background-color: red; } HTML <td id="vaadin-grid-cell-1" tabindex="0" role="gridcell" part="cell body-cell" first-column="" reorder-status="undefined" aria-selected="false" class="error_row" style="width: 100px; flex-grow: 1; order: 10000000;"><slot name="vaadin-grid-cell-content-1"