JavaScript API Reference/Ab.view.View object

View.registerControl(win, controlName, newControl)

Register new control instance in the view, so that any other view part can obtain a reference to the control using the View.getControl() function.

Parameters:

  • win (String or Window object reference): window or frame reference or name. Typically the control is registered for the window that contains it, i.e. the ' window ' object.
  • controlName (String): unique name of the control.
  • newControl (JS object): control instance. The control class must extend the Ab.view.Component class in order to be registered.


Example:

Register custom control from its constructor function.

View.registerControl(window, 'mycontrol', this);


Note that all custom controls should extend the Ab.view.Component class that automatically registers the control instance in its constructor.