Skip to main content

Lifecycle

note

When loading from XML the value of a field is set later than you might expect which can cause problems if your field constructor needs information from the workspace.

note

A field object is created before being attached to a block. This can cause problems if your field constructor needs information from the workspace.

Field creation happens in the order below.

  1. The field's constructor is called.

    1. The constructor sets the value to the provided or default value.
    2. The constructor sets the local validator but does not call it.
  2. Field is appended to the block.

    1. setSourceBlock is called
    2. If the field is on a rendered workspace, init is called.
      1. The fieldGroup_ is created and appended.
      2. initView is called.
      3. bindEvents_ is called.
  3. Field XML value is set.

Flowchart describing construction and initialization of a field