ComponentLifecycleEvents interface is implemented by classes that need to observe a particular
component's life-cycle events.
module:ct-component/Component instances themselves automatically implement this
Component life cycle events are emitted by the object that hosts the components. This is either the top-level
module:ct-component/frame/FrameManager for the application, or any composite type component that itself
contains other components. Overriding any of the methods in this listener interface is optional, but doing so will
enable you to react to the related event.
FrameManager determines whether the event methods are called immediately before or immediately
after the event they refer to.
Invoked when the frame becomes the active or focused frame within the page.
Invoked when the frame containing this component is closed.
This method should be used to clean up any resources the component currently has open, including subscriptions and
any other listeners that may have been registered. Once
onClose() has been called no further methods
will be called for this component.
It is possible for the
onClose() method to be invoked before
onOpen() if the component
was instantiated but never displayed (for example if the user was not permissioned to view the component) in which
case this method should only be used to clean up any resources it has opened within its constructor, and not those
that it would have opened within
Invoked when the frame ceases to be the active or focused frame within the page.
Invoked when a frame is no longer in view. It should stop or suspend any resources that may be processor intensive, such as subscriptions, so they are not active whilst the frame is hidden.
Invoked when the frame has been maximized.
Invoked when the frame has been minimized.
Invoked when the frame is first displayed. It will only ever be called once, which will always be after the
module:ct-component/Component#getElement method has been called on the
FrameManager implementations must invoke this method after the element returned by
Component#getElement has been added to the page. Initalisation code that needs to know the size of
the component, or that uses the computed CSS styles that will only become valid after the component's HTML has been
added to the view should be placed here.
The width of the frame, in pixels.
The height of the frame, in pixels.
Invoked when the dimensions of the frame change.
The new width of the frame, in pixels.
The new height of the frame, in pixels.
Invoked when the frame has been restored from a minimized or maximized state.
Invoked when a frame that has been hidden (see
module:ct-component/ComponentLifecycleEvents#onHide) is now back in view. It should restore any resources
that were stopped or suspended by
N.b. this method is not called when the component within the frame is first displayed, see