vaadin7

Vaadin 7 - instant download of dynamically created file

依然范特西╮ 提交于 2019-12-11 06:05:59
问题 My scenario is: using Vaadin 7.7.10 , I have on click generated file, that I want to download once it is generated. I have generator method, that returns byte[] (could be also easily modified to any OutputStream if needed), then I create StreamResource from it. So I have the resource ready to be downloaded, but now what? I believe can't use approach with FileDownloader , because there I would have to generate the file every time the page is displayed prior to actual click on extended button

Deploying Vaadin App in Openshift

给你一囗甜甜゛ 提交于 2019-12-11 05:29:12
问题 I just created my first Vaadin application. The application works fine on my local server. I want to upload this app to Openshift. I followed the instructions here: https://www.openshift.com/kb/kb-e1088-how-to-deploy-pre-compiled-java-applications-war-and-ear-files-onto-your-openshift-gear The app has been uploaded, but the only thing that is displayed is text. No panels or CSS or anything. Does anyone have any idea why this is happening? Thank you! Console: Jul 01, 2014 8:39:50 AM com.vaadin

Vaadin JavaScript unload event listener not firing

北城以北 提交于 2019-12-11 05:17:50
问题 I have a Vaadin 7 application where I need to reliably detect a user leaving or navigating away from a page in order to carry out some cleanup. My aim is to have the page pop up a confirmation dialog on browser/tab close, and if the user chooses to leave the page, then at that point I perform the cleanup operation. I am fairly inexperienced at JavaScript, but from what I have discovered 'onbeforeunload' and 'onunload' are the functions to use. At this point in time, I am using the following

Spring boot with vaadin run jetty even though I use tomcat

ぐ巨炮叔叔 提交于 2019-12-11 05:09:24
问题 I try to use Spring boot with Vaadin 7.7.0. By default, spring boot use tomcat if I don not specify. However, I found there is a log as below: 2016-08-26 12:08:49.897 INFO 3240 --- [ main] e.j.JettyEmbeddedServletContainerFactory : Server initialized with port: 8080 2016-08-26 12:08:49.900 INFO 3240 --- [ main] org.eclipse.jetty.server.Server : jetty-8.y.z-SNAPSHOT I check the dependency through eclipse and there is no jetty. Here is the dependency for the problem How could a such strong

Change from “Valo” theme to “Reindeer” in new Vaadin 7.3 app

心已入冬 提交于 2019-12-11 03:13:16
问题 In new Vaadin 7.3 apps created with the Vaadin Plugin for NetBeans, the default theme is the new Valo theme. Valo is hip-looking, and very important technology for the future. On the downside, Valo is huge in its default sizing. Until I learn how to downsize the Valo widgets, I need to switch my app back to the professional-looking business-app-oriented Reindeer theme. How to change my code and project settings to use Reindeer theme throughout my app? 回答1: You could just change the UI

Creating components as static factory style (Singleton) in Vaadin

依然范特西╮ 提交于 2019-12-11 02:43:37
问题 I would like to create custom Window using static factory style (or with singleton pattern). public class MyWindow extends CustomComponent { private static Window window; private static MyWindow instance; public static MyWindow getInstance() { if (instance == null) { instance = new MyWindow(); } return instance; } public void show() { UI.getCurrent().addWindow(window); } private MyWindow() { CustomLayout layout = new CustomLayout("My HTML Layout"); window = new Window("My Window"); window

How to bind a Vaadin DateField to a LocalDateTime

微笑、不失礼 提交于 2019-12-11 02:08:00
问题 The Vaadin docs show how to use the DateField with java.util.Date but I want to bind the DateField with a BeanFieldGroup to a bean property of Java 8 type java.time.LocalDateTime . How can I achieve that? 回答1: Seems like a Vaadin Converter is the way to go: package org.raubvogel.fooddiary.util; import java.time.LocalDateTime; import java.time.ZoneOffset; import java.util.Date; import java.util.Locale; import com.vaadin.data.util.converter.Converter; /** * Provides a conversion between old {

Vaadin TextField action at every key pressed

℡╲_俬逩灬. 提交于 2019-12-11 01:44:22
问题 In Vaadin 7 there are no KeyListener in TextField only on EnterKey press. I'm looking for an add-on which contains a SuperImmediateTextField but compatible with Vaadin 7. I use Vaadin version 7.1.8 回答1: You can use TextChangeListener. For example: // Text field with maximum length final TextField tf = new TextField("My Eventful Field"); tf.setValue("Initial content"); tf.setMaxLength(20); // Counter for input length final Label counter = new Label(); counter.setValue(tf.getValue().length() +

Make an OptionGroup (radio buttons) from an enum in Vaadin 7?

柔情痞子 提交于 2019-12-11 00:11:54
问题 I have a Java enum with a getter for the desired display text. How can I use this to populate an OptionGroup in Vaadin 7? 回答1: Here are three ways to do this in Vaadin 7: A class I built, EnumBackedOptionGroup . A subclass of OptionGroup in Vaadin 7. Roll-your-own the short sweet way. Roll-your-own the more flexible way. Subclass of OptionGroup Here is the source code of a new subclass of OptionGroup I wrote. package com.basilbourque; import com.vaadin.ui.OptionGroup; import java.util.Arrays;

Get sibling of Vaadin Tree Item?

痴心易碎 提交于 2019-12-10 23:14:31
问题 I need to get the siblings of a particular Item in a Vaadin Tree. I can do this: Object itemId = event.getItemId(); Object parentId = tree.getParent( itemId ); Collection siblings = tree.getChildren( parentId ); BUT there is a problem when the itemId is one of the roots, for instance: item1 childen1.1 children1.2 item2 item3 When I want siblings of item1 . Any help? 回答1: When an item has no parent (aka tree.getParent(itemId) == null ) then it's a root, so its siblings are the other root items