vaadin

Vaadin HybridMenu shift with scrollpanel

流过昼夜 提交于 2019-12-25 11:58:08
问题 I want to add scrollbar to my web app so I can see every components on my browser. Red rectangle in picture below is Grid. Grid is placed inside class that extends VerticalLayout and implements View. Green color shows my scrollbar which is added to HybridMenu instance. HybridMenu root = HybridMenuBuilder.get() .setContent(new VerticalLayout()) .setMenuComponent(EMenuComponents.LEFT_WITH_TOP) .setConfig(menuConfig) .build(); root.addStyleName("scrollpanel"); root.setSizeFull(); super

stored procedure 'auto_pk_for_table' not found

痴心易碎 提交于 2019-12-25 09:11:29
问题 I don't know why I received the error : org.apache.cayenne.CayenneRuntimeException: [v.4.0.M5 Feb 24 2017 07:47:55] Commit Exception [...] Caused by: java.sql.SQLException: Procédure stockée 'auto_pk_for_table' introuvable. [...] I'm using Cayenne : <dependency> <groupId>org.apache.cayenne</groupId> <artifactId>cayenne-server</artifactId> <version>4.0.M5</version> </dependency> and JDTS for sql server : <dependency> <groupId>net.sourceforge.jtds</groupId> <artifactId>jtds</artifactId>

Internationalization in Vaadin with property file

荒凉一梦 提交于 2019-12-25 08:47:58
问题 I found a useful example for internationalization in Vaadin. Here is online-demo for this. I tried with combobox for locale change as .. private Locale localeMyanmar, localeEnglish; private static final String LOCALE_COOKIE = "locale"; ....... localeMyanmar = new Locale("my", "Burmese"); localeEnglish = Locale.ENGLISH; ......... final ComboBox cbLanguage = new ComboBox(); cbLanguage.addStyleName("comboIconCaption"); cbLanguage.setNullSelectionAllowed(false); cbLanguage.setImmediate(true);

how to retrieve the newly added item to vaadin combobox with a button click

落花浮王杯 提交于 2019-12-25 07:59:46
问题 My problem is a simple one. I am trying to add a new Item to a Vaadin ComboBox, which is already populated with some data, by clicking a button. I want the newly added item to be available in the button click event handler so that I can add the same to database table. ComboBox region = new ComboBox(); for (RegionDetails details : regions) { int regionId = details.getRegionId(); String regionName = details.getRegionName(); region.addItem(regionId); region.setItemCaption(regionId, regionName);

Vaadin JavaScript popup only works first time in each session

≡放荡痞女 提交于 2019-12-25 07:26:35
问题 I have an application which requires a process to be cleaned up regardless of how the user exits the page. I'm using JavaScript to detect when the user exits the page via tab or browser closing, and showing a popup to ensure they know the current process will be stopped. This question regards the pop-up only, I just wanted to clarify why I needed one! When the user presses a button to start the process, the following code is called: JavaScript.getCurrent().execute( "var beforeCloseListener =

Vaadin: How To programmatically perform a KeyPressEvent on TAB-Button?

狂风中的少年 提交于 2019-12-25 05:19:12
问题 is there a way to programmatically perform a Button Press Event i.e for the TAB -Button in Vaadin? I have to write a test for a ShortCutListener, which listens to ShortCut ShortCutAction.KeyEvent.TAB . I have tried something like that: Button button = new Button(); button.addShortcutListener(new ShortcutListener("ShortCut", ShortcutAction.KeyCode.TAB, null) { private static final long serialVersionUID = 1L; @Override public void handleAction(Object sender, Object target) { System.out.println(

What is the difference between elemental.json and com.google.json library?

佐手、 提交于 2019-12-25 04:29:53
问题 Why do we have elemental.json library over com.google.json? I'm struggling with the creation of JsonArray in Vaadin 7. In Json.createArray() there is no add method. How can I create a json array? I want to create an array like: var shapeArray = [ {type: 'rectangle', x:50, y:50, width : 50, height: 50}, {type: 'circle', x:75, y:150, r : 20}, {type: 'rectangle', x:50, y:200, width : 100, height: 20}, {type: 'circle', x:75, y:300, r : 30}, ]; Am I missing something? 回答1: As per this official

Set or Get Color for ListSeries in VAADIN Charts

和自甴很熟 提交于 2019-12-25 04:22:08
问题 From the following VAADIN Charts Demo Link you can see a basic bar graph, https://demo.vaadin.com/charts/#BasicColumn The colors of the bars we can see here are coming from CSS file and not the JAVA Source Code File. Is there no way possible to set or get the colors for this bars? Please Note: 1) I cannot use DataSeries instead of ListSeries, since with Data Series achieving a view like the one shown in the above link is not possible(or I am not aware of). 2) I have already checked other

Set or Get Color for ListSeries in VAADIN Charts

南楼画角 提交于 2019-12-25 04:21:02
问题 From the following VAADIN Charts Demo Link you can see a basic bar graph, https://demo.vaadin.com/charts/#BasicColumn The colors of the bars we can see here are coming from CSS file and not the JAVA Source Code File. Is there no way possible to set or get the colors for this bars? Please Note: 1) I cannot use DataSeries instead of ListSeries, since with Data Series achieving a view like the one shown in the above link is not possible(or I am not aware of). 2) I have already checked other

How to sort a ComboBox in Vaadin?

心不动则不痛 提交于 2019-12-25 03:55:11
问题 I have a ComboBox and provide the data with a BeanItemContainer . I also attach a sorter for default sorting. But the result is always unsorted. Why? public class Car { private String name; } private ComboBox box = new ComboBox("sorted cars"); BeanItemContainer<Car> cont = new BeanItemContainer<>(Car.class); //cont.addItem();... System.out.prinltn(cont.getSortableContainerPropertyIds()); //prints: [name] box.setItemSorter(new DefaultItemSorter()); box.sort(new Object[] {"name"}, new boolean[]