vaadin

Setting content of my `UI` subclass in Vaadin Flow web app

本秂侑毒 提交于 2019-12-24 04:12:28
问题 In Vaadin Flow, writing a subclass of UI class is no longer necessary. Yet the page of the manual on Differences Between V10 and V8 Applications suggests we are free to do so. The problem: The UI class in Flow has no UI::setContent method. This usual line of code in our UI::init method fails in Flow: this.setContent( layout ); // <--- No method `setContent` found in Flow ➥ How do we set the content to be displayed within our UI subclass at runtime? Here is my code, with the line of setContent

Setting content of my `UI` subclass in Vaadin Flow web app

亡梦爱人 提交于 2019-12-24 04:11:30
问题 In Vaadin Flow, writing a subclass of UI class is no longer necessary. Yet the page of the manual on Differences Between V10 and V8 Applications suggests we are free to do so. The problem: The UI class in Flow has no UI::setContent method. This usual line of code in our UI::init method fails in Flow: this.setContent( layout ); // <--- No method `setContent` found in Flow ➥ How do we set the content to be displayed within our UI subclass at runtime? Here is my code, with the line of setContent

Spring(-Boot) & Vaadin - Set default-view in Vaadin navigator

风格不统一 提交于 2019-12-24 03:50:54
问题 first of all I have here a simple UI which has a addMenueItem() Method. This method gets a view-id and adds a button to the menue and tells the navigator from Vaadin to navigate to it on click: ......... @PostConstruct private void initPage() { navigator.addProvider(viewProvider); contentLayout.setSizeFull(); } protected void addMenuItem(final String viewId) { final String postfix; if (viewId == null || viewId.trim().isEmpty()) { postfix = ""; } else { postfix = "." + viewId; } final String

java.io.NotSerializableException is thrown while restarting Vaadin application

痞子三分冷 提交于 2019-12-24 02:23:14
问题 When I restart my Tomcat, I get the following error: 2014;10;01; 15;49;47;055; WARN; com.vaadin.event.ListenerMethod;[localhost-startStop-2]; Error in serialization of the application: Class com.aaa.bbb.MyServlet$1 must implement serialization. 2014;10;01; 15;49;47;055; WARN; org.apache.catalina.core.ContainerBase.[Catalina].[localhost].[/my-vaadin];[localhost-startStop-2]; Cannot serialize session attribute com.vaadin.server.VaadinSession.MyServlet for session ... java.io

java.io.NotSerializableException is thrown while restarting Vaadin application

风格不统一 提交于 2019-12-24 02:23:05
问题 When I restart my Tomcat, I get the following error: 2014;10;01; 15;49;47;055; WARN; com.vaadin.event.ListenerMethod;[localhost-startStop-2]; Error in serialization of the application: Class com.aaa.bbb.MyServlet$1 must implement serialization. 2014;10;01; 15;49;47;055; WARN; org.apache.catalina.core.ContainerBase.[Catalina].[localhost].[/my-vaadin];[localhost-startStop-2]; Cannot serialize session attribute com.vaadin.server.VaadinSession.MyServlet for session ... java.io

Vaadin - How to limit component squishiness and overlap?

早过忘川 提交于 2019-12-24 02:06:56
问题 Vaadin 7.6.2 Consider this example: import com.vaadin.ui.HorizontalLayout; import com.vaadin.ui.Panel; import com.vaadin.ui.TextField; public class MyClass extends Panel { TextField myField = new TextField(); TextField myField2 = new TextField(); HorizontalLayout hLayout = new HorizontalLayout(); public MyClass() { super(); applySettings(); } private void applySettings() { myField.setCaption( "Field1" ); myField.setWidth( 100, Unit.PERCENTAGE ); myField2.setCaption( "Field2" ); myField2

Vaadin -layout resizing overlaps

旧巷老猫 提交于 2019-12-24 00:38:46
问题 Im facing overlaps problem with my project when trying to resize browser. I was trying so many different variations to make it work, but still result is not acceptable. Before resizing: A , B and C are contained in VerticalLayout - I will call it root . Root is inside HorizontalLayout - content of UI . A is simple component. B is extending VerticalLayout that contains 2 HorizontalLayouts inside. C is only one component - Grid. Now, when Im trying to resize my browser (like arrow shows) C is

Vaadin: value from DateField is null after conversion

蓝咒 提交于 2019-12-24 00:28:42
问题 I faced with problem that I'm incapable to save typed date in the DateField to the database. I'm using Hibernate as ORM framework and there is Order entity that has java.sql.Date fields. But as far as I know DateField works only with LocalDate/LocalDateTime. So then in order to bind those fields I created Converter class. The problem was that the Converter received a null value and that's why I got a stacktrace, but the issue was solved in this thread: Vaadin DateField saves null value to

Vaadin Change the default Session Expired Notification?

偶尔善良 提交于 2019-12-23 19:45:51
问题 Vaadin 7.6.2 How to change the default Session Expired Notification; both the message and the type of notification? 回答1: To change session expired message you need to create your own SystemMessagesProvider , where you define it. For example in a servlet deployment, you could do the following: @WebServlet(urlPatterns = "/*", name = "MyUIServlet", asyncSupported = true) @VaadinServletConfiguration(ui = MyUI.class, productionMode = false) public static class MyUIServlet extends VaadinServlet {

Vaadin: open new window with ABSOLUTE url path from a BUTTON

旧巷老猫 提交于 2019-12-23 18:31:38
问题 I have a table with addresses. I have a button you can click which I want to open a google search for the address in a separate window. I have tried this code with BrowserWindowOpener. getUI().getPage().open(url, "_blank") and BrowserWindowOpener opener = new BrowserWindowOpener(url); opener.extend(googleBtn) but both are appending my url to the current path. I want to simply run a search in google in a separate window. I'm sure this is much simpler than I'm making it. It sure should be, at