vaadin

Java/Vaadin - FormLayout custom hidden component implementation

我们两清 提交于 2019-12-13 17:14:22
问题 I am working on a web application in vaadin and am currently trying to implement an address book. I viewed the official implementations off github and tried to build off that. The issue I am experiencing is with the contact form. I want to be able to click a row in the grid and open up a form containing the information. (Similar to how it is done on their example) The component doesn't react as intended however. If I added the component directly to the main layout and try to toggle visibility

How to open a Vaadin ComboBox by code?

点点圈 提交于 2019-12-13 15:25:56
问题 Is it possible to open a Vaadin ComboBox by code? I'd like to present 2 comboboxes that depend on each other. When the user selects a value in the first, I'd like the 2nd combobox to automatically open the possible selections, so that the user can directly select one, instead of having to open the 2nd combobox himself. Maybe there is an event that I could send to trigger the opening? 回答1: The only thing I can think of is, after giving focus to the combobox, try sending it a keystroke (ie the

How to fill Vaadin Grid with Map items type

此生再无相见时 提交于 2019-12-13 08:52:36
问题 I want to fill my Vaadin Grid with Map<String, Object> items. Thats because I get my data from database like this(maybe it's main problem): List<Map<String, Object>> result = jdbcTemplate.queryForList("select * from db", new Object[]{}); Now lets say that I create my test List and fill it with some maps: List<Map<String, Object>> items = new ArrayList<>(); items.add(map); items.add(map2); I know how to do it with non dynamic data model, for example: grid.addColumn(Person::getName).setCaption(

How to reverse vaadin Grid?

ぃ、小莉子 提交于 2019-12-13 07:57:16
问题 I'm trying to build a simple java application using Spring Boot and Vaadin. I need to add a table on UI like this: https://www.screencast.com/t/1c4xkr4IE It could be extended by periods. Looks like Vaadin Grid element perfectly fits my requirements, but it adds my rows as columns. Is it possible to reverse grid or maybe there is another way to build needed table? UPDATE Here are my code: @SpringComponent @UIScope public class MyDataEditor extends VerticalLayout { private final

Using the FileDownloader with Combobox

那年仲夏 提交于 2019-12-13 07:34:58
问题 I've tried using the new FileDownloader in Vaadin7. Unfortunately, it needs an AbstractComponent for the "extend" component (where it listens for the clicks) Is there a way to use it with combobox items? As they are not AbstractComponents and thus do not fit with the "extend" method. 回答1: The Vaadin forums have discussed this a lot, and there is no scheme now using FileDownloader or the similarly functioning BrowserWindowOpener. They all only work on AbstractComponents, and thus don't work on

Vaadin grid setBodyRowHeight doesn't exist in latest 8.1.4 API

允我心安 提交于 2019-12-13 07:25:34
问题 I'm trying to adjust the height of the rows since I'm using components and the Vaadin Grid documentation says you can do this by calling setBodyRowHeight however that method no longer seems to be available... UPDATE: I found the method setRowHeight() (the manual needs updating) however this also changes the column header row height which I don't want, I just want the rows to be taller (so the component fits) and not the header. 回答1: It appears that this is an issue in the latest version and

How to access an Image Dom Element with Vaadin/GWT?

别来无恙 提交于 2019-12-13 05:42:50
问题 I have an HTML Dom looking like this: <div class="mydiv" id="mydivId"> <img src="../xyz.png" class="gwt-Image imgWrapper" draggable="false"> </div> I'm trying to change the img Source, so i made the following to access the image without success: Image imageElement = (Image) Document.get() .getElementById("mydivId") .getElementsByTagName("img").getItem(0); How can i get the <img> dom element as Image then change its Source? 回答1: Get the ImageElement with ImageElement image = (ImageElement) DOM

Pass information to new web-browser window/tab being opened with BrowserWindowOpener in Vaadin 8

不羁岁月 提交于 2019-12-13 04:33:19
问题 In Vaadin 8, we can let the user open a new tab/window within their web browser by clicking a button that has been associated with a BrowserWindowOpener. As discussed in the manual, a new UI is instantiated on our behalf. All we pass is a .class object, the class of our UI subclass to be instantiated for display in the new window/tab. For example: BrowserWindowOpener opener = new BrowserWindowOpener( PersonDetailUI.class ); That works for me. My question is: How do I pass some information to

Vaadin Table Collapse Column Listener

被刻印的时光 ゝ 提交于 2019-12-13 04:24:33
问题 I want to know which columns are collapsed & uncollapsed, in vaadin. Is there a listener for this, I could not found? 回答1: It's not supported out the box. However you could extends Table to support it. Something like public class ColumnCollapsedObservableTable extends Table { private List<ColumCollapsedListener> collapseListeners = new ArrayList<ColumCollapsedListener>(); @Override public void setColumnCollapsed(Object propertyId, boolean collapsed) throws IllegalStateException { super

Vaadin 7.1.0 - DefaultWidgetSet can't be found

北慕城南 提交于 2019-12-13 04:23:42
问题 I am new to Vaadin and I am trying to do some Tests with this technology. I Set up my project as a Maven Project under Eclipse with a Tomcat 7 Server. At first I started with Vaadin 7.0.0 and everything works fine. Now I change the Version from 7.0.0 to 7.1.0 because I like to test the push functionality. With Vaadin 7.0.0 everything works fine, but since I changed the Version I get the error: Requested resource [/VAADIN/widgetsets/com.vaadin.DefaultWidgetSet /com.vaadin.DefaultWidgetSet