vaadin-flow

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

Vaadin LoginForm - signaling when user passed or failed authentication

会有一股神秘感。 提交于 2020-04-30 07:17:09
问题 I understand that in using the Login component of Vaadin 14, I must call addLoginListener to register a listener of my own that implements ComponentEventListener<AbstractLogin.LoginEvent> . In my implementing code, I can call the LoginEvent::getUsername and LoginEvent::getPassword methods to obtain the text values entered by the user. My listener code then determines if these credentials are correct. ➥ By what mechanism does my listener code communicate back to my LoginForm the results of the

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

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

Simple example of filtering items in a grid in Vaadin Flow 14

自闭症网瘾萝莉.ら 提交于 2020-03-02 07:11:29
问题 I want to suppress the display of some items in a Grid widget in Vaadin Flow 14. For example, if the user enters a year in a IntegerField widget, I want the grid to show only items with an associated date before that year. Items with a date on or after that date should disappear. If the user changes the year number, the filtering should be re-applied with fewer or more items displayed appropriately in the grid. I have seen filters on Grid discussed but cannot wrap my head around the various

Simple example of filtering items in a grid in Vaadin Flow 14

时间秒杀一切 提交于 2020-03-02 07:09:16
问题 I want to suppress the display of some items in a Grid widget in Vaadin Flow 14. For example, if the user enters a year in a IntegerField widget, I want the grid to show only items with an associated date before that year. Items with a date on or after that date should disappear. If the user changes the year number, the filtering should be re-applied with fewer or more items displayed appropriately in the grid. I have seen filters on Grid discussed but cannot wrap my head around the various

Engage “Lumo compact mode” in Vaadin 13 and later, for smaller size layouts

瘦欲@ 提交于 2020-03-01 10:04:32
问题 The release notes for Vaadin 13 includes an item for Lumo compact mode. The mention there is brief, lacking details. To quote: The compact theme/preset defines values for the sizing and spacing properties to reduce the visual space required by components to better fit a large amount of content on the screen. It’s a Lumo-only feature and can be enabled by importing the preset file to the application. How do I turn on this compact mode in my Vaadin 14 web app? 回答1: Add two annotations:

Engage “Lumo compact mode” in Vaadin 13 and later, for smaller size layouts

南笙酒味 提交于 2020-03-01 10:04:22
问题 The release notes for Vaadin 13 includes an item for Lumo compact mode. The mention there is brief, lacking details. To quote: The compact theme/preset defines values for the sizing and spacing properties to reduce the visual space required by components to better fit a large amount of content on the screen. It’s a Lumo-only feature and can be enabled by importing the preset file to the application. How do I turn on this compact mode in my Vaadin 14 web app? 回答1: Add two annotations:

Set width of “Dialog” widget to a percentage of the page in Vaadin 14

佐手、 提交于 2020-02-25 22:35:29
问题 In Vaadin 14, the Dialog widget opens properly when specifying width and height by px (CSS virtual "pixels"). Dialog dialog = new Dialog(); dialog.setCloseOnEsc( true ); dialog.setCloseOnOutsideClick( true ); dialog.add( new Label( "whatever" ) ); dialog.setWidth( "500px" ); // 🡸 width dialog.setHeight( "700px" ); // 🡸 height Unfortunately, changing that 500px to 80% : dialog.setWidth( "80%" ); // 🡸 width as percentage (%) dialog.setHeight( "700px" ); // 🡸 height I expect the dialog to now

Get the IP address of the user’s web browser via Java on the server-side in a Vaadin 14 app

爱⌒轻易说出口 提交于 2020-02-25 02:27:07
问题 In Vaadin Flow, such as version 14.1, how can I get the IP address of the user’s web browser through a Java call on the server-side? Like the Question, Get user’s IP address, and other client-side info in Vaadin 7 web app, but for Vaadin Flow instead of Vaadin 7 & 8. 回答1: WebBrowser::getAddress In Vaadin Flow, use the class WebBrowser::getAddress to get the user's IP address. To get a WebBrowser object, ask the current VaadinSession object. String ipAddress = VaadinSession.getCurrent()