Feature #1299
open"disabled" edited by a js
0%
Description
Hi,
I am disabling formWidgets from a javascript (checkbox changed -> some widgets gets enabled and another disabled). Than I have a cancel button (handled by server) which restores default values. The checkbox value is restored but the enabled/disabled states don't (and I really call setEnabled(bool) ).
I am missing some version of setEnabled(bool) that allows using a force to propagate the disabled state to web (something like addStyleClass (const WString &styleClass, bool force=false) ).
Thanks,
Jan
Updated by Wim Dumon almost 13 years ago
Hello Jan,
Wt indeed has a mechanism to avoid rendering unnecessary changes to the widget tree, so a setEnabled(true);
on a widget that was enabled will be optimized away.
My proposal: instead of calling setEnabled(true);
, do a setEnabled(false); setEnabled(true);
which will force rerendering. It's a bit of a hack but it will work.
Regards,
Wim.