vaadin

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: display a list in table

亡梦爱人 提交于 2019-12-11 03:15:49
问题 I have the need to display all values contained in a list in a table. For example: class Person { String name; String age; List<Rule> rules; } the result that I expect: |name |age |rules alex 22 administrator, user, etc.. where administrator and user belong to Rule.name property Does anyone know how to do that? 回答1: You should be able to add a generated column and format the values from the list as you need. You can find an example here, just scroll down to chapter 5.16.5 Generated Table

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

What's effective way to write Vaadin project ?

回眸只為那壹抹淺笑 提交于 2019-12-11 02:43:21
问题 I'm looking for effective approach to writing Java web app in Vaadin. (several pages, a lot of tables, buttons..) From what should I start ? It's good solution to begin from writing all needed components, layouts, panels and next merge all that to build single pages ? or maybe it's better to write every single page with no thinking about the entire project (of course, except changing pages), so for example: first I write login page (and all stuff I need for it), next I write admin page etc..

TomEE throwing IndexOutOfBoundsException

a 夏天 提交于 2019-12-11 02:22:01
问题 I am trying to deploy a Vaadin/JEE6 application to TomEE. The following exception is thrown during deployment: org.apache.catalina.LifecycleException: Failed to start component [StandardEngine[Catalina].StandardHost[localhost].StandardContext[/myapp]] at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:152) at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:812) at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:787) at org.apache

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 {

How To Implement Scroll Listener In Vaadin 7 Tables

南楼画角 提交于 2019-12-11 01:54:06
问题 In Vaadin, when you scroll down or up in tables ( com.vaadin.ui.Table ) there is no event that will be fired to tell you that user is now scrolling. Why would we need scroll event in table? Let's first take a look at this example of Vaadin (Dashboard Demo) after you open the link just click sign in, and you'll be automatically redirected to the transactions page, this page shows a table of financial transactions, these transactions will show a batch after another while you are scrolling, what

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() +

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