Is there a possibility to change the Theme at runtime in rapidclipse? I do have user who like the dark theme where other users prefere the light theme.
As of now I just have the @Theme annotation which is setting one theme.
Is there a possibility to change the Theme at runtime in rapidclipse? I do have user who like the dark theme where other users prefere the light theme.
As of now I just have the @Theme annotation which is setting one theme.
I could not find anything in the Vaadin Documentation regarding dynamic setting of the Theme-Variant.
But looking around I found this tutorial https://vaadin.com/learn/tutorials/toggle-dark-theme#_option_2_change_between_light_and_dark_theme_on_the_fly
By adding and removing Lumo.DARK from UI.getCurrent().getElement().getThemeList() I was able to switch between light and dark.
Downsides to this as the comments from that tutorial suggest, this seems to be more of a workaround than an actual solution. If the body tag overflows then you will see a white page where it overflows.
I hope this still helps.
Found a solution for Vaadin 7.7.13:
this.getUI().setTheme("MyTheme");
I have packed the code into an clicklistener of a button. "MyTheme" has to be present under WebContent/Vaadin/themes