This website uses cookies for visitor traffic analysis. By using the website, you agree with storing the cookies on your computer.More information

Dynamically set css' with Vaadin 7

Have you ever tried to add/remove/change style sheets of Vaadin components dynamically, without css file modification? We didn't find suitable methods in Vaadin' standard components.

We miss methods like

setStyle("margins: 2px;");
addStyle("padding-left: 5px;");
removeStyle("padding-left: 5px;");

in Vaadin. It's very easy to change style sheets with css files that are included in your project(s), but if you need a little bit more control... or must create dynamic applications - it's not possible out-of-the-box.

I'm not sure why there are no such methods, because GWT has all of them?

But no worries, with Vaadin 7 it's easy to add support for CSS manipulation. Simply use UI Extensions.

You'll find our CssExtension in our Vaadin UI project.

JVx with Maven

We're pleased to announce that JVx is available in the public maven repositories.

Use following dependency in your pom.xml:

<dependency>  
   <groupId>com.sibvisions.jvx</groupId>  
   <artifactId>jvxall</artifactId>  
   <version>1.1</version>  
</dependency>

for your server project and following dependency:

<dependency>  
   <groupId>com.sibvisions.jvx</groupId>  
   <artifactId>jvxclient</artifactId>  
   <version>1.1</version>  
</dependency>

for your client project.
The differences between jvxclient and jvxall are: The client does not contain server classes and is about 200Kb smaller.