vaadin-flow

Vaadin Flow/10/11 style component via css

廉价感情. 提交于 2019-12-02 09:54:31
My question is pretty basic. How to add styling from a css-file to a basic vaadin component? What I do NOT want to use: PolymerTemplate getStlye().set(...) Do I have to @ImportHtml, which includes the css-code or do I have to @StyleSheet with the css-file? And afterwards, do I have to add the "css-style" via .getElement().getClassList().add(...)? I really need help to have a working simple code example for a Label, Button or whatsever, please . I cannot find anything to satisfy my requirements. In our documentation we guide to use @ImportHtml in MainView for global styles as a html style

Dynamically changing font, font-size, font-color, and so on in Vaadin Flow web apps

倾然丶 夕夏残阳落幕 提交于 2019-12-02 09:42:18
In Vaadin Flow (versions 10 and later), is there some way to dynamically change the font, font size, font color and such of the widgets in a Vaadin layout? I do know the basics of CSS , but don’t know much about SASS or other supersets of CSS though I am willing to learn. And I do not know what supersets of CSS are being used by Vaadin Flow. I know I can dynamically assign or remove CSS style names to a widget at runtime. But that means the CSS style must already be defined. ➥Is there some way to assign arbitrary font styling at runtime? The short answer is yes. And this is one of the major

Get current VaadinContext and current VaadinSession (both places to store state as “attribute” key-value pairs) in Vaadin Flow

ⅰ亾dé卋堺 提交于 2019-12-02 05:01:38
问题 In using Vaadin Flow, version 14, I know we can store state as key-value pairs kept as "attributes" via getAttribute / setAttribute / removeAttribute methods found on: VaadinSession (per-user scope) VaadinContext (web-app scope) How does one access the current object for those classes? 回答1: VaadinSession.getCurrent() For that per-user scope , the VaadinSesion class provides a static class method getCurrent to access the current instance. VaadinSession session = VaadinSession.getCurrent() ; //

Get current VaadinContext and current VaadinSession (both places to store state as “attribute” key-value pairs) in Vaadin Flow

孤人 提交于 2019-12-02 00:44:29
In using Vaadin Flow, version 14, I know we can store state as key-value pairs kept as "attributes" via getAttribute / setAttribute / removeAttribute methods found on: VaadinSession (per-user scope) VaadinContext (web-app scope) How does one access the current object for those classes? VaadinSession.getCurrent() For that per-user scope , the VaadinSesion class provides a static class method getCurrent to access the current instance. VaadinSession session = VaadinSession.getCurrent() ; // Fetch current instance of `VaadinSession` to use its key-value collection of attributes. session

MenuBar widget in Vaadin Flow (Vaadin 10) missing?

自作多情 提交于 2019-12-01 22:17:42
Vaadin Framework (Vaadin 8) offers a MenuBar widget, as discussed in the manual , and shown in the Sampler . When I switch the manual to "Vaadin 10" mode, I cannot find the MenuBar widget. I know Vaadin 10 (Vaadin Flow) is a major re-write of Vaadin, is the widget changed in name or not yet available? Possibly in Vaadin 14 Update: A MenuBar widget is planned for development by Vaadin Ltd, scheduled for Vaadin 14 release. See the manual . On GitHub, see Issue # 4694 MenuBar component . No MenuBar in Vaadin 10 or 11 As discussed in this Forum thread , as of version 11.0.1, Vaadin Flow currently

Where to store `UI`-object scoped state in a Vaadin 14 app?

江枫思渺然 提交于 2019-11-28 06:49:04
问题 Context (web app) To store state available to our entire Vaadin app, we can get and set "Attribute" on the VaadinContext object that represents our entire Vaadin-based web app at runtime. These attributes act as a key-value collection, where the key is of type String and the value is of type Object . We access the context by calling UI.getCurrent().getSession().getService().getContext() . Session (per user) To store state available to any one user’s session, we can similarly get and set

New Vaadin 14 app fails to run, error “Failed to determine 'node' tool.” Missing Node.js and npm tools

流过昼夜 提交于 2019-11-27 04:46:21
问题 I used the Get Started page to create a new Vaadin 14 app, after choosing the Plain Java Servlet option. The web page successfully downloaded a .zip file which I unzipped, and opened with IntelliJ Ultimate Edition version 2019.2. I waited a few minutes while Maven did its thing, downloading and reconfiguring the project. Eventually I went to the Maven panel within IntelliJ, and ran the Lifecycle items clean and install . I received the following error message on the console. [ERROR] Failed to