HTML Client 5.0.1

Class OverwriteTable


class OverwriteTable
extends VisualTable

A data table that can be fed with real-time data delivered by Lightstreamer Server and displayed into a screen table in such a way that newer values for a field of an item overwrite older ones. The class contains the subscription details and the event handlers needed to allow Lightstreamer to display the real-time data.
A screen table suitable for the visualization of pushed values should be made of a matrix of HTML cells. Such cells can be defined at page loading, through PushPage.cellOverwrite(), or can be attached to the page DOM at any time, as DIV, SPAN or INPUT elements owning the "source='Lightstreamer'" special attribute, together with proper "item", "field" and "table" attributes; the latter defines the screen table id. The association is made when the data table is brought to the "running" state, through the identifier supplied to PushPage.addTable(), that must match the screen table id. A ScreenTableHelper can also be used to this purpose also enabling the possibility to specify tags other than SPAN DIV and INPUT.
Each pushed value is displayed in a cell that is associated to the involved item and field. By default the new value will replace the cell's content (or its value in case the cell is an INPUT or a TEXTAREA element). It is possible to override this behavior by specifying a special "update" attribute containing the name of the attribute of the cell to be updated. Any string can be specified; moreover a value of a stylesheet can be specified using the "style.attribute" form (note that the DOM attribute name should be used, not the CSS name; e.g. "style.backgroundColor" is correct, while "style.background-color" is not). WARNING: also events like "onclick" can be assigned; in such cases make sure that no malicious code will be pushed by the Data Adapter (for example through the injection of undesired JavaScript code).
Note: the cell/item association depends on the value specified in the "item" attribute of each cell, which should be a valid item descriptor. Similarly, the cell/field association depends on the value specified in the "field" attribute of each cell, which should be a valid field descriptor. Only one cell for each item-field combination is supported.
The initial contents and stylesheets supplied to the cells will also be used when cell clearing has to be performed (the stylesheet used is the one supplied through the "class" attribute).
Note that the HTML cells form a "logical" matrix, determined by the "item" and "field" attribute values, but this is not a constraint on the placement of the cells in the page or even in the HTML structure. In particular, if the group consists of just one item, it may not represent a row of data, but rather an aggregate of independent values.
More visualization actions can be performed through the event handlers provided.

Defined in lspushpage.js

Constructor Summary
OverwriteTable (<GroupDescriptor> tGroup, <SchemaDescriptor> tSchema, <String> tSubscriptionMode)
            Creates an object to be used to describe a data table whose values should be displayed into existing HTML cells.
Method Summary
 void onChangingValues(<Number> itemPos, <VisualUpdateInfo> updateInfo, <String> itemName)
           Event handler that is called by Lightstreamer each time an update pertaining to an item in the data table is being shown on the associated screen table.
Methods inherited from class VisualTable
setClearOnRemove, setClearOnDisconnected, setClearOnAdd, setPushedHtmlEnabled, isPushedHtmlEnabled, showValues
Methods inherited from class Table
getSchema, getGroup, setDataAdapter, getId, setSelector, setItemsRange, setRequestedMaxFrequency, setRequestedBufferSize, setSnapshotRequired, onItemUpdate, onLostUpdates, onEndOfSnapshot, onStart, getClassName

Constructor Detail


OverwriteTable(<GroupDescriptor> tGroup, <SchemaDescriptor> tSchema, <String> tSubscriptionMode)

Method Detail


void onChangingValues(<Number> itemPos, <VisualUpdateInfo> updateInfo, <String> itemName)

HTML Client 5.0.1

Lightstreamer HTML Client API
Documentation generated by JSDoc on Tue May 22 11:46:54 2012