vaadin10

How to download a file with Vaadin 10?

拈花ヽ惹草 提交于 2019-12-11 09:29:29
问题 I want to let user to download a file from server. I looked up for the solution and when trying to make an example - ended up with this: @Route("test-download") public class Download extends VerticalLayout { public Download() { Anchor downloadLink = new Anchor(createResource(), "Download"); downloadLink.getElement().setAttribute("download", true); add(downloadLink); } private AbstractStreamResource createResource() { return new StreamResource("/home/johny/my/important-file.log", this:

How to make REST Call Logout work with Spring Boot, Vaadin 10 and Keycloak 4?

柔情痞子 提交于 2019-12-11 09:28:58
问题 I tried this with Keycloak 4.4.0.Final and 4.6.0.Final. I checked the keycloak server log and I saw the following warning messages in the console output. 10:33:22,882 WARN [org.keycloak.events] (default task-1) type=REFRESH_TOKEN_ERROR, realmId=master, clientId=security-admin-console, userId=null, ipAddress=127.0.0.1, error=invalid_token, grant_type=refresh_token, client_auth_method=client-secret 10:40:41,376 WARN [org.keycloak.events] (default task-5) type=LOGOUT_ERROR, realmId=demo,

Vaadin 10 Button redicted to URL

a 夏天 提交于 2019-12-11 03:44:23
问题 On a click on a Button, I need to do some action and then redirect to an external url. All example I find are for older Vaadin version, and doesn't work on Vaadin 10. Can someone provide an example please ? 回答1: In most cases I would recommend you to use the new Anchor component in Vaadin 10+. Its purpose is to cover your use case, replace BrowserWindowOpener, etc. If your use case is to redirect non-logged in users to external SSO login page, then I would do it differently. I would not do

vaadin 10 - Push - Label won't update

谁都会走 提交于 2019-12-11 00:13:26
问题 MainView include InformationCOmponent: @Push @Route public class MainView extends VerticalLayout { InformationComponent infoComponent; public MainView(@Autowired StudentRepository studentRepo, @Autowired Job jobImportCsv, @Autowired JobLauncher jobLauncher, @Value("${file.local-tmp-file}") String inputFile) { [...] // some stuffs infoComponent = new InformationComponent(studentRepo); add(infoComponent); } //update when job process is over private void uploadFileSuccceed() { infoComponent

How to secure Vaadin flow application with Spring Security

南笙酒味 提交于 2019-12-10 14:39:43
问题 I'm trying to integrate vaadin 10 with spring security (using the spring project base provided by vaadin), and I'm confused on how they interact exactly. If I go to a protected url (in this example, "/about") typing it directly in the browser, the login page shows up. If I go to the same URL by clicking in a link from the UI, the page shows up even if I'm not authenticated. So I guess that Vaadin is not going through Spring Security's filter chain, but then how do I secure my resources inside

Replacement for `AbsoluteLayout` from Vaadin 8 Framework in Vaadin 10 Flow?

泪湿孤枕 提交于 2019-12-06 02:01:33
问题 The AbsoluteLayout in Vaadin 8 (Framework) enables pixel-position-oriented placement of widgets within a layout. While not my first layout of choice, the AbsoluteLayout is suited to porting code from other UI-building platforms that use pixel-position-oriented layout. Example code from the manual: // A 400x250 pixels size layout AbsoluteLayout layout = new AbsoluteLayout(); layout.setWidth("400px"); layout.setHeight("250px"); // A component with coordinates for its top-left corner TextField

How to perform an Load Test/Performance Test with Vaadin 10 (is it possible with Jmeter?)

筅森魡賤 提交于 2019-12-04 14:01:45
I Work on an Vaadin 10 Project and we want to perform an Load Test on our Website befor we used Vaadin 10 we could do that with Jmeter but with Vaadin 10 it seems that it doesnt work with Jmeter We Tryed using Jmeter 5.1.1 and recorded the testcase the first problem was the csrf Toaken and the push id, both could get extracted with an regular expression extractor and we put them in the Body Data {"csrfToken":"${csrf}","rpc": [{"type":"mSync","node":5,"feature":1,"property":"invalid","value":true}]," syncId":0,"clientId":0} as far as i could see at least that worked but the only result we get

Replacement for `AbsoluteLayout` from Vaadin 8 Framework in Vaadin 10 Flow?

你离开我真会死。 提交于 2019-12-04 06:30:49
The AbsoluteLayout in Vaadin 8 ( Framework ) enables pixel-position-oriented placement of widgets within a layout. While not my first layout of choice, the AbsoluteLayout is suited to porting code from other UI-building platforms that use pixel-position-oriented layout. Example code from the manual : // A 400x250 pixels size layout AbsoluteLayout layout = new AbsoluteLayout(); layout.setWidth("400px"); layout.setHeight("250px"); // A component with coordinates for its top-left corner TextField text = new TextField("Somewhere someplace"); layout.addComponent(text, "left: 50px; top: 50px;"); I

Vaadin Flow/10/11 style component via css

时光怂恿深爱的人放手 提交于 2019-12-02 18:07:19
问题 My question is pretty basic. How to add styling from a css-file to a basic vaadin component? What I do NOT want to use: PolymerTemplate getStlye().set(...) Do I have to @ImportHtml, which includes the css-code or do I have to @StyleSheet with the css-file? And afterwards, do I have to add the "css-style" via .getElement().getClassList().add(...)? I really need help to have a working simple code example for a Label, Button or whatsever, please . I cannot find anything to satisfy my

Vaadin Flow/10/11 style component via css

廉价感情. 提交于 2019-12-02 09:54:31
My question is pretty basic. How to add styling from a css-file to a basic vaadin component? What I do NOT want to use: PolymerTemplate getStlye().set(...) Do I have to @ImportHtml, which includes the css-code or do I have to @StyleSheet with the css-file? And afterwards, do I have to add the "css-style" via .getElement().getClassList().add(...)? I really need help to have a working simple code example for a Label, Button or whatsever, please . I cannot find anything to satisfy my requirements. In our documentation we guide to use @ImportHtml in MainView for global styles as a html style