Runtime Life Cycle of Custom Controls

The ControlWrapper implementation is subject to a very specific life cycle, which is described in the figure ControlWrapper Life Cycle.

ControlWrapper Life Cycle

Preparation

The forms runtime repeatedly calls the ControlWrapper's isReady() method until it returns true.

Initialization

The forms runtime calls the constructor function to create an instance of the ControlWrapper and then calls the initialize() method on this instance.

Refresh

Whenever you update the configuration or value of the control, the form invokes the ControlWrapper.refresh() method to give the ControlWrapper a chance to update the rendering of the control.

Destruction

When the form is being taken out of service, it invokes the destroy() method on the ControlWrapper.

Note: If a control is within a static pane, the form does not create an instance of the ControlWrapper. Instead, it invokes the renderStatic() for the ControlWrapper to get the markup used in the static mode.