vaadin

What purpose is served by the `SerializableFunction` interface defined in Vaadin 8 if we can simply pass a regular Lambda expression in its place?

时光总嘲笑我的痴心妄想 提交于 2019-12-13 03:47:56
问题 Vaadin 8 defines a functional interface, SerializableFunction. This interface appears in various places. For example, when defining a Converter for displaying non-textual types in a TextField such as a UUID. Binder.BindingBuilder<BEAN,TARGET>::withConverter(SerializableFunction<TARGET,NEWTARGET> toModel, SerializableFunction<NEWTARGET,TARGET> toPresentation) See class documentation. Example usage: binder .forField( this.idField ) .withConverter( text -> UUID.fromString( text ) , uuid -> uuid

Pass and receive data in Vaadin

孤者浪人 提交于 2019-12-13 03:34:05
问题 I have a view: @SpringUI(path="order") @Title("order") public class OrderGUI extends UI{ and I would pass parameter to other: @SpringUI(path="orderNumber") @Title("Order number") public class GetOrderNumber extends UI { I tried to send parameter(orderNumber) by: getUI().getPage().setUriFragment(orderNumber); getUI().getPage().setLocation("orderNumber"); then it goes to /orderNumber but when tried to catch it by: String fragment = getPage().getUriFragment(); but System.out.println("Fragment: "

Vaadin filters in Grid

感情迁移 提交于 2019-12-13 02:06:41
问题 i have problem with filters in Vaadin. Its easy to make filters for each column in Grid. But now i need to do one filter for all cells in Grid. I don't know how to do this. I was trying to do this like in this example, but it doesn't worked Filter f = new Or(new SimpleStringFilter(Columns.SEARCH.id(), "rpm-diastolic", true, false), new Or(new SimpleStringFilter(Columns.SEARCH.id(), "rpm-systolic", true, false)), new Or(new SimpleStringFilter(Columns.SEARCH.id(), "rpm-weight", true, false))) ;

How to place Vaadin confirmdialog ok and cancel button in center

对着背影说爱祢 提交于 2019-12-13 01:53:13
问题 I have been using the ConfirmDialog add-on from the Vaadin Directory. Is it possible to put the OK and Cancel buttons in the center of the window? By default it is in the right corner of the window. 回答1: Just create a layout with buttons in the middle and set it as the content of ConfirmDialog. You can get the buttons using ConfirmDialog.get...Button(). Example: ConfirmDialog cd = ConfirmDialog.getFactory().create("Title", "", "OK", "Cancel"); cd.setHeight("400px"); cd.setWidth("400px");

How to Print in Vaadin Flow?

三世轮回 提交于 2019-12-13 01:28:31
问题 I would like to print out the content of a homepage created with Vaadin 14 from a button. with Vaadin 8 was a solution that unfortunately is no longer applicable: Button print = new Button("Print This Page"); print.addClickListener(new Button.ClickListener() { public void buttonClick(ClickEvent event) { // Print the current page JavaScript.getCurrent().execute("print();"); } }); Any Idea how to do this in Vaadin14 please? 回答1: In Vaadin 10 and later, you can run arbitrary JavaScript by

open popup through Link in Vaadin

陌路散爱 提交于 2019-12-13 01:25:25
问题 I am Using Vaadin Framework in my application. I want to open a popup screen using Vaadin Link. I know to open popup thrugh button but I need to open popup through Link. Can anybody help, this is my code: Link link1 = new Link(String.valueOf(rs.getInt(1)), new ExternalResource("#")); _reportTable.getItem(dashboardDataRowId) .getItemProperty("todo").setValue(link1); 回答1: As explained in in Book of Vaadin - Components - Link, Link should be used only for hyperlinks to external resources, as it

Trying to get xjsinteropmode JS working

江枫思渺然 提交于 2019-12-13 00:37:12
问题 I'm trying to try out vaadin polymer elements with GWT and I'm having a heck of time getting going. I'm using GWT 2.8 SNAPSHOT in Eclipse and I cannot get a basic project to run because of XjsInteropmode. The error says to add it to Super Dev Mode, so I've added it to the run arguments as well as the GWT compile arguments and I'm still getting an error saying to double check that I'm compiling with the -XjsInteropmode JS' flag... What am I missing? 回答1: 2.8 snapshot already used the new specs

getItemProperty returns not null - Vaadin bug?

天涯浪子 提交于 2019-12-13 00:32:22
问题 I need help, maybe I am blind. Here is a fragment of my code: System.out.println("itemPropertyIDS="+item.getItemPropertyIds().toString()); System.out.println("argname="+argName); Property<?> p = item.getItemProperty(argName); if (p != null) { System.out.println("p="+p.toString()); return p.getValue(); } // Continue ... It returns a currious null value instead of continue, even if the propertyId doesn't exists. This is written on my console: itemPropertyIDS=[iconName, iconResource, nodeType,

How to recalculate column widths on scroll down(not programmatic) to a previously hidden row of a Vaadin Grid when its HeightMode is CSS

Deadly 提交于 2019-12-12 23:02:32
问题 My application is similar to Vaadin Dashboard Demo (please click login after you visit this link). So all my mini dashboard items are wrapped around an abstract component that is of height 300px. One of those items is a Grid wrapped around this 300px height abstract component. My customer hates it when he sees a large column and .v-grid-cell cuts his cell off: text-overflow: ellipsis; So in the @PostConstruct of my Vaadin Grid(and everywhere I mess with the container) i have this

Hyperlink inside label field in Vaadin 12

断了今生、忘了曾经 提交于 2019-12-12 22:19:34
问题 In Vaadin 12, I can't seem to create a hyperlink (or for that matter, any "normal" http entries) inside a label field. It just ends up displaying my commands as text. Here's my code: final Label lblRunMs = new Label("<ol><li>Please now run your mass spectrometer (MS) using the gs-DIA method files built in the previous step.</li><li>While the MS is running, the generated MS files will be automatically and in near real-time imported (eg ~60 seconds after the MS files have been created) imported