Project

General

Profile

MKWProgressBar setValueStyleClass

Added by Maximilian Kleinert over 8 years ago

Hi,

I have a WProgressBar connected to a WFileupload. After the file was (successfully uploaded) it is validated. Since I am using the Bootstrap theme I want to visualize the validation result via the WProgressBar.
Therefore I tried to call in the ValidationFailure/ValidationSuccess callbacks:
setValueStyleClass("progress-bar-danger");
or
setValueStyleClass("progress-bar-success");

But the css style is not updated. Using setValueStyleClass works as expected when I call it before the WProgressBar is rendered the first time.
How can I send the updated ValueStyleClass in the browser?

I tried to derive from WProgressBar and override updateBar(Wt::DomElement & bar) but without success.

Thank you,
Max


Replies (3)

LA RE: WProgressBar setValueStyleClass - Added by lm at over 8 years ago

Where is setValueStyleClass declared?

Have you tried addStyleClass?

MK RE: WProgressBar setValueStyleClass - Added by Maximilian Kleinert over 8 years ago

It is declared in WProgressBar.
Yes I have tried, but the html for the WProgressBar looks like:

100 %

And addStyleClass affects the outer div element and there progress-bar-success has no effect. Whereas setValueStyleClass affects the first inner div which is the right place but this only works before the widget is rendered.

BR
Max

MK RE: WProgressBar setValueStyleClass - Added by Maximilian Kleinert over 8 years ago

Here is an example code to illustrate the problem.

BR
Max

main.cpp (4.02 KB) main.cpp
    (1-3/3)