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
.
Attributes | Name and Description |
---|---|
|
caplin.presenter.component.PresenterComponent(String sTemplateId, Object vPresentationModel)
Constructs a new instance of |
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 |
|
void
removeComponentLifecycleListener(caplin.component.ComponentLifecycleEvents oListener)
Remove a previously registered component life-cycle event listener. |
►
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:
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. |
►
void
addComponentLifecycleListener(caplin.component.ComponentLifecycleEvents oListener)
Add a component life-cycle event listener.
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.
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.
caplin.component.ComponentLifecycleEvents | oListener | The listener being removed. |