Project

General

Profile

Feature #1299

"disabled" edited by a js

Added by Jan HrubeŇ° over 10 years ago. Updated over 10 years ago.

Status:
New
Priority:
Normal
Assignee:
-
Target version:
-
Start date:
05/21/2012
Due date:
% Done:

0%

Estimated time:

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

#1

Updated by Wim Dumon over 10 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.

Also available in: Atom PDF