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.

When component life cycle events are triggered on the PresenterComponent these are proxied through to the PresentationModel if they are defined in the PresentationModel.

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.

void deserialize(String sPresenterData)

Extracts the data inside the presenter tag and gives it to the PresentationModel for deserialization.

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, getUniqueComponentId, setContainer, setFrame
Methods from caplin.core.Serializable:
getSerializedState
Methods from caplin.component.ComponentLifecycleEvents:
onActivate, onClose, onDeactivate, onHide, onMaximize, onMinimize, onOpen, onResize, onRestore, onShow

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.

void deserialize(String sPresenterData)

Extracts the data inside the presenter tag and gives it to the PresentationModel for deserialization. Only has affect if the Presentation Model implements caplin.presenter.SerializablePresentationModel.

Parameters
String sPresenterData The presenter xml node in string format

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.