Constructor
new module:caplin/element/renderer/MultiStreamRenderer()
A multi stream renderer.
Extends
- module:caplin/element/Renderer
- module:caplin/element/RendererFramework
- module:caplin/element/renderer/StreamRenderer
Methods
-
addRendererEventListener(oRendererEventListener)
-
Adds a
module:caplin/element/RendererEventListener
to which the Renderer will communicates user-gestures.Parameters:
Name Type Description oRendererEventListener
module:caplin/element/RendererEventListener The renderer event listener. - Inherited From:
-
bind(eControlElement)
-
Binds the renderer to the DOM and attaches any event listeners to the control.
Parameters:
Name Type Description eControlElement
HtmlElement The DOM element representing the renderer -
bindHandlers()
-
Binds event listeners to the control for all the handlers, which will result in a callbacks to the
onRendererEvent()
method then any event occurs.- Inherited From:
-
buildXhtml(mFieldValues, className)
-
Parameters:
Name Type Description mFieldValues
Object className
Object - Inherited From:
-
clear()
-
Clears the renderer value and all associated state, including the displayed value. The renderer will remain bound to the DOM.
- Inherited From:
-
clearState()
-
Clears the renderer state without clearing the displayed value. This is a performant version of clear for when you are going to update the displayed value immediately after clearing.
- Inherited From:
-
createHtml(mFieldValues, sClassName) → {String}
-
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:
- The simplest way is to use the
module:caplin/element/RendererFramework#getElement
helper method — this invokescreateHtml()
andmodule:caplin/element/RendererFramework#bind
on your behalf. - A more performant mechanism for components that contain large numbers of renderers is to use
invoke
module:caplin/element/RendererFramework#createHtml
andmodule:caplin/element/RendererFramework#bind
yourself, so that the entire concatenated string containing the HTML for all renderers can be created using a single use call toinnerHTML
, allowing significant performance gains to be achieved.
This method must be called after the
FieldModel
has been set usingFieldModel.setFieldModel()
. If theFieldModel
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 tomodule:caplin/element/Renderer#setValue
afterwards.Parameters:
Name Type Description mFieldValues
Map The field values sClassName
String The HTML class attribute (a space separated list) - Inherited From:
- See:
Returns:
The HTML fragment.- Type
- String
- The simplest way is to use the
-
createXhtml(sClassName) → {String}
-
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().
Parameters:
Name Type Description sClassName
String The HTML class attribute (a space separated list) - Inherited From:
Returns:
The HTML fragment.- Type
- String
-
disable()
-
Disables the renderer control. Does nothing if the control has no concept of enabled/disabled.
- Inherited From:
-
enable()
-
Enables the renderer control. Does nothing if the control has no concept of enabled/disabled.
- Inherited From:
-
finalize()
-
Releases any renderer resources and resets its state.
- Inherited From:
-
focus()
-
Moves the focus to this renderer. Does nothing if the control has no concept of focus.
- Inherited From:
-
getAllFieldNames() → {Array}
-
Returns a complete list of all field names that the renderer depends on.
- Inherited From:
Returns:
The field names.- Type
- Array
-
getControl() → {module:caplin/control/Control}
-
Returns a control corresponding to the renderer.
- Inherited From:
Returns:
The control -
getElement() → {Element}
-
Returns the element that this renderer is associated with.
If the renderer binding was not performed manually using
module:caplin/element/RendererFramework#createHtml
andmodule:caplin/element/RendererFramework#bind
, then this helper method will do this automatically on your behalf.- Inherited From:
- See:
-
- module:caplin/element/RendererFramework#createHTML
- module:caplin/element/RendererFramework#bind
- module:caplin/element/RendererFramework#unbind
Returns:
The element associated with this renderer.- Type
- Element
-
getFieldValues()
-
Returns the fields relating to the currently displayed value.
- Inherited From:
Returns:
The field values. -
getFormattedValue()
-
Returns the formatted downstream value.
- Inherited From:
Returns:
The formatted downstream value. -
getName()
-
Returns the renderer name. This is set by the framework that instantiates the Renderer (e.g. the grid) and represents the field context (e.g. "Bid Price").
- Inherited From:
Returns:
The renderer's name. -
getNamespace()
-
Returns the renderer namespace. This is set by the framework that instantiates the Renderer (e.g. the grid) and represents the record context (e.g. "/FX/GBPUSD").
- Inherited From:
Returns:
The renderer's namespace. -
getParsedValue()
-
Returns the parsed upstream value.
- Inherited From:
Returns:
The parsed upstream value. -
getPrimaryFieldNames() → {Array}
-
Returns a list of primary fields.
- Inherited From:
Returns:
The field names.- Type
- Array
-
getSerialId() → {String}
-
Returns the serial id of the renderer instance.
- Inherited From:
Returns:
The renderer serial id.- Type
- String
-
getUnformattedValue()
-
Returns the unformatted downstream value.
- Inherited From:
Returns:
The unformatted downstream value. -
getUnparsedValue()
-
Returns the unparsed upstream value.
- Inherited From:
Returns:
The unparsed upstream value. -
getValue()
-
Gets the renderer value.
- Inherited From:
Returns:
vRendererValue The renderer value. -
getVariable(variableName) → {String}
-
Gets the renderer's variable.
Parameters:
Name Type Description variableName
String The variable name to retrieve. - Inherited From:
Returns:
The variable value- Type
- String
-
initialize(mInitialFieldValues)
-
Initializes the renderer and sets its state according to the supplied field values.
Parameters:
Name Type Description mInitialFieldValues
Map The initial field values - Inherited From:
-
isBound() → {boolean}
-
Returns true if the renderer has been bound to the DOM.
- Inherited From:
- See:
Returns:
True if the renderer has been bound to the DOM, or false otherwise.- Type
- boolean
-
isEnabled()
-
Determines whether the control is enabled.
- Inherited From:
Returns:
true if the control is enabled. -
onRendererEvent(domEvent)
-
Event handler callback function that receives the events attached to the controls and defined in the handlers.
All control events call this function.
Parameters:
Name Type Description domEvent
Object The DOM event that was fired - Inherited From:
-
raiseEvent(sType, mRendererEvent)
-
Raises a renderer event.
Parameters:
Name Type Description sType
String The renderer event type. mRendererEvent
Map The renderer event to raise. - Inherited From:
-
refresh()
-
Apply all pending updates
- Inherited From:
-
removeRendererEventListener(oRendererEventListener)
-
Removes a
module:caplin/element/RendererEventListener
to which the Renderer will communicate user-gestures.Parameters:
Name Type Description oRendererEventListener
module:caplin/element/RendererEventListener The renderer event listener. - Inherited From:
-
resetUnformattedStreamValue()
-
Creates a null value for this renderer type
-
select()
-
Moves the focus and highlights this renderer. Does nothing if the control has no concept of focus.
- Inherited From:
-
setName(sName)
-
Sets the renderer's name.
Parameters:
Name Type Description sName
String The renderer's name. - Inherited From:
-
setNamespace(sNamespace)
-
Sets the renderer's namespace.
Parameters:
Name Type Description sNamespace
String The renderer's namespace. - Inherited From:
-
setSerialId(serialId)
-
Sets the serial id.
Parameters:
Name Type Description serialId
int The serial id - Inherited From:
-
setValue(vRendererValue)
-
Sets the renderer value.
Parameters:
Name Type Description vRendererValue
Variant The renderer value. - Inherited From:
-
toString() → {String}
-
Returns a human-readable string representation of the object, which is useful for debugging.
Returns:
The string representation- Type
- String
-
unbind()
-
Unbinds the renderer from the DOM and detaches any event listeners to the control.
-
unbindHandlers()
-
Unbinds event listeners from the control for all the handlers.
- Inherited From:
-
updateFields(mFieldValues)
-
Updates the renderer with the supplied fields. The field values will be reflected in the control on the next call to {module:caplin/element/Renderer#refresh}. The Renderer might depend on these fields either because it has been bound to them in the constructor, or if the XML renderer definition refers to these fields using the ${} notation. Additional field values can be supplied and they will have no effect on the displayed value, but they will be returned by {module:caplin/element/Renderer#getFieldValues}. This can exploited to hold additional information about the value (such as price ID or timestamp).
Parameters:
Name Type Description mFieldValues
Map the new field values. - Inherited From:
-
updateFieldValues(mFieldValues)
-
Updates the field values.
Parameters:
Name Type Description mFieldValues
Map The field values. - Inherited From:
-
updateStreamValues(fieldValuesMap)
-
Updates the renderer with the new value.
Parameters:
Name Type Description fieldValuesMap
Map The field values map. - Inherited From: