Project

General

Profile

Feature #7968

Revert delay of WWidget::load()

Added by Roel Standaert about 2 months ago. Updated about 1 month ago.

Status:
Resolved
Priority:
Normal
Assignee:
-
Target version:
Start date:
01/11/2021
Due date:
% Done:

0%

Estimated time:

Description

Issue #4888 called for the delay of WWidget::load() until after rendering.

A common use case for load() is to lazily create and add a widget to the widget tree, like DeferredWidget in the widget gallery.

Some of those widgets may use require() to load JavasScript, which when done post-render can lead to issues related to the order in which JavaScript is loaded and lead to JavaScript errors.

The original motivation for issue #4888 was that a child may be added to the parent in their constructor before the child is sufficiently initialized. This is no longer possible in Wt 4, so that reason is no longer valid.

We can prevent JavaScript issues by reversing that change in Wt 4.


Files

lazyMenu.cpp (1.72 KB) lazyMenu.cpp Example app Roel Standaert, 01/11/2021 02:38 PM

Also available in: Atom PDF