Class
caplin.presenter.component

PresenterComponent

The PresenterComponent class allows Caplin components (widgets that can be embedded within a layout or opened within a dialog) to be constructed using a caplin.presenter.PresentationModel and an HTML template.

Constructor Summary

Attributes Name and Description
caplin.presenter.component.PresenterComponent(String sTemplateId, Object vPresentationModel)

Constructs a new instance of PresenterComponent.

Method Summary

Attributes Name and Description
void addComponentLifecycleListener(caplin.component.ComponentLifecycleEvents oListener)

Add a component life-cycle event listener.

caplin.presenter.PresentationModel getPresentationModel()

Retrieve the presentation model being displayed by this component.

boolean isViewAttached()

Returns true once caplin.component.ComponentLifecycleEvents#onOpen has fired, and the element returned from #getElement has been attached to the page.

void removeComponentLifecycleListener(caplin.component.ComponentLifecycleEvents oListener)

Remove a previously registered component life-cycle event listener.

Methods implemented from class caplin.component.Component:
getContainer, getElement, getPermissionKey, getSerializedState, getUniqueComponentId, setContainer, setFrame

Constructor Detail

caplin.presenter.component.PresenterComponent(String sTemplateId, Object vPresentationModel)

Constructs a new instance of PresenterComponent.

Instances of PresenterComponent can also be created from an XML snippet using the following methods:

Parameters
String sTemplateId The id of a template to render the presentation model with.
Object vPresentationModel A presentation model instance, or the name of a presentation model class that can be constructed.

Method Detail

void addComponentLifecycleListener(caplin.component.ComponentLifecycleEvents oListener)

Add a component life-cycle event listener.

Parameters
caplin.component.ComponentLifecycleEvents oListener The listener being registered.

caplin.presenter.PresentationModel getPresentationModel()

Retrieve the presentation model being displayed by this component.

boolean isViewAttached()

Returns true once caplin.component.ComponentLifecycleEvents#onOpen has fired, and the element returned from #getElement has been attached to the page.

void removeComponentLifecycleListener(caplin.component.ComponentLifecycleEvents oListener)

Remove a previously registered component life-cycle event listener.

Parameters
caplin.component.ComponentLifecycleEvents oListener The listener being removed.