Project

General

Profile

Actions

Feature #7968

closed

Revert delay of WWidget::load()

Added by Roel Standaert over 3 years ago. Updated over 2 years ago.

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

100%

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
Actions #1

Updated by Roel Standaert over 3 years ago

Attaching an example application that shows an error when clicking on the "TinyMCE" menu option.

Actions #2

Updated by Roel Standaert about 3 years ago

  • Status changed from New to Resolved
Actions #3

Updated by Roel Standaert over 2 years ago

  • % Done changed from 0 to 100
Actions #4

Updated by Roel Standaert over 2 years ago

  • Status changed from Resolved to Closed
Actions

Also available in: Atom PDF