Project

General

Profile

Actions

Feature #1299

open

"disabled" edited by a js

Added by Jan Hrubeš almost 12 years ago. Updated almost 12 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

Actions #1

Updated by Wim Dumon almost 12 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.

Actions

Also available in: Atom PDF