Important Notice - Forums is archived
To simplify things and help our users to be more productive, we have archived the current forum and focus our efforts on helping developers on Stack Overflow. You can post new questions on Stack Overflow or join our Discord channel.

TUTORIALVaadin lets you build secure, UX-first PWAs entirely in Java.
Vaadin lets you build secure, UX-first PWAs entirely in Java.
Free ebook & tutorial.
Calling javascript synchronously by Enver Haase, 1 month ago
ProgressIndicator Customisation
Hi,
I want to create a new component based on ProgressIndicator component.
This one should have the color RED for values under 0.5 and GREEN for values above.
I tried to use widgets but i didn't knew how to change styles dynamically.
Can someone help me.
Last updated on Jan, 31st 2012
Here's a simple example
Define two styles.
.red .v-progressindicator-indicator {
background: #f00 none;
}
.green .v-progressindicator-indicator {
background: #0f0 none;
}
Initially set
ProgressIndicator p = new ProgressIndicator();
p.addStyleName("red");
and when you update the value over 0.5
p.removeStyleName("red");
p.addStyleName("green");
Last updated on
+1
You cannot reply to this thread.