Opened 8 years ago

Closed 8 years ago

Last modified 8 years ago

#13887 closed task (fixed)

simplify startup() code

Reported by: bill Owned by: bill
Priority: high Milestone: 1.7
Component: Dijit Version: 1.6.1
Keywords: Cc:
Blocked By: Blocking:

Description (last modified by bill)

Simplify startup() code:

  1. Remove isContainer: flag and instead make all widgets obey the isContainer:true contract of starting their children.
  2. Move _Container.startup() to _WidgetBase
  3. In parser, when deciding which widgets to startup, just check widget._started flag. No need to call getParent(), because if the widget did have a parent, the parent would have called startup() and _started would already be set.

Also, remove _Container.destroyDescendants() since it's redundant with _WidgetBase.destroyDescendants().

Change History (4)

comment:1 Changed 8 years ago by bill

Description: modified (diff)
Summary: simply startup() codesimplify startup() code

comment:2 Changed 8 years ago by bill

Resolution: fixed
Status: newclosed

In [26531]:

Simplification of startup() code:

  1. Remove isContainer: flag and instead make all widgets obey the isContainer:true contract of starting their children.
  2. Move _Container.startup() to _WidgetBase.
  3. Move _Contained.getParent() to _WidgetBase, alongside getChildren(). But isContainer related code was removed.
  4. Removed _Container.destroyDescendants() since it was redundant with _WidgetBase.destroyDescendants()
  5. In parser, when deciding which widgets to startup, just check widget._started flag. No need to call getParent(), because if the widget did have a parent, the parent would have called startup() and _started would already be set.


Fixes #13886, #13887 !strict.

comment:2 Changed 8 years ago by bill

In [26740]:

Fix problems where ContentPane was not calling startup() on non-widget children. Fixes #13971, refs #13887 !strict.

comment:3 Changed 8 years ago by bill

In [26762]:

At the time that submitButton.startup() is called, form.isValid() isn't ready to give the right answer. Switch form.isValid() call to run after form.startup() completes. Refs #13971, #13887.

Note: See TracTickets for help on using tickets.