ControlFramework
interface specifies those lifecycle functions that are necessary
for a control implementation to be managed by the Control Framework.
Attributes | Name and Description |
---|---|
|
caplin.element.RendererFramework()
|
Attributes | Name and Description |
---|---|
|
void
bind(HtmlElement eControlElement)
Binds the renderer to the DOM and attaches any event listeners to the control. |
|
String
createHtml(Map mFieldValues, String sClassName)
Returns a string containing the HTML that defines this element. |
|
String
createXhtml(String sClassName)
Creates an XHTML fragment using the current field value obtained from the FieldModel. |
|
void
finalize()
Releases any renderer resources and resets its state. |
|
Array
getAllFieldNames()
Returns a complete list of all field names that the renderer depends on. |
|
Element
getElement()
Returns the element that this renderer is associated with. |
|
Array
getPrimaryFieldNames()
Returns a list of primary fields. |
|
String
getSerialId()
Returns the serial id of the renderer instance. |
|
void
initialize(Map mInitialFieldValues)
Initializes the renderer and sets its state according to the supplied field values. |
|
boolean
isBound()
Returns true if the renderer has been bound to the DOM. |
|
void
setName(String sName)
Sets the renderer's name. |
|
void
setNamespace(String sNamespace)
Sets the renderer's namespace. |
|
void
unbind()
Unbinds the renderer from the DOM and detaches any event listeners to the control. |
►
caplin.element.RendererFramework()
►
void
bind(HtmlElement eControlElement)
Binds the renderer to the DOM and attaches any event listeners to the control.
HtmlElement | eControlElement | The DOM element representing the renderer |
►
String
createHtml(Map mFieldValues, String sClassName)
Returns a string containing the HTML that defines this element.
This is the first of two steps required to bind a renderer to its corresponding HTML element. In fact, there are two ways of binding a renderer:
createHtml()
and #bind on your behalf.innerHTML
,
allowing significant performance gains to be achieved.This method must be called after the FieldModel
has been set using
FieldModel.setFieldModel()
. If the FieldModel
is populated with
some initial data for this renderer, then the HTML fragment returned will also contain that value, obviating
the need for an call to caplin.element.Renderer#setValue afterwards.
Map | mFieldValues | The field values |
String | sClassName | The HTML class attribute (a space separated list) |
►
String
createXhtml(String sClassName)
Creates an XHTML fragment using the current field value obtained from the FieldModel. The caller must write the XHTML to the DOM in some efficient way.
This method must be called after the FieldModel has been set using setFieldModel().String | sClassName | The HTML class attribute (a space separated list) |
►
void
finalize()
Releases any renderer resources and resets its state.
►
Array
getAllFieldNames()
Returns a complete list of all field names that the renderer depends on.
►
Element
getElement()
Returns the element that this renderer is associated with.
If the renderer binding was not performed manually using #createHtml and #bind, then this helper method will do this automatically on your behalf.
►
Array
getPrimaryFieldNames()
Returns a list of primary fields.
►
String
getSerialId()
Returns the serial id of the renderer instance.
►
void
initialize(Map mInitialFieldValues)
Initializes the renderer and sets its state according to the supplied field values.
Map | mInitialFieldValues | The initial field values |
►
boolean
isBound()
Returns true if the renderer has been bound to the DOM.
►
void
setName(String sName)
Sets the renderer's name.
String | sName | The renderer's name. |
►
void
setNamespace(String sNamespace)
Sets the renderer's namespace.
String | sNamespace | The renderer's namespace. |
►
void
unbind()
Unbinds the renderer from the DOM and detaches any event listeners to the control.