|
HTML Client 5.0.1 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Object | +--Table | +--VisualTable | +--DynaMetapushTable
A data table that can be fed with real-time data
delivered by Lightstreamer Server and displayed into a screen table
according to ADD, UPDATE and DELETE commands received as pushed values,
which instruct the data table to either add a row, just modify values on a row
or delete a row.
We call this a "COMMAND logic" behaviour.
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 is
dynamically maintained by Lightstreamer, starting from an HTML hidden
template row, containing cells. The template row can be provided as any
HTML element owning the "source='Lightstreamer'" special attribute,
while the element "ID" attribute 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.
The contained cells are defined as any DOM elements owning the
"source='Lightstreamer'" special attribute, together with a "field"
attribute.
For each pushed update, the involved row is determined and each
value is displayed in a cell that is associated to the involved row
and field. If necessary, new rows are cloned from the hidden template
and attached after it, or existing rows are dropped.
By default the new/updated value will be set as 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/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 field is supported in the template.
Note that the template element can contain an arbitrary HTML structure
and should contain HTML cells to be used to display the row field
values. However, it should not contain elements to which an ID has been
assigned, because the elements will be cloned and the HTML
specification prescribes that an ID must be unique in the document.
(The ID of the template element, required by Lightstreamer, is not
cloned).
More visualization actions can be performed through the provided event
handlers.
See:
Constructor Summary | |
DynaMetapushTable
(<GroupDescriptor> tGroup, <SchemaDescriptor> tSchema, <String> tSubscriptionMode)
Creates an object to be used to describe a data table to be managed with a "COMMAND logic" behaviour. |
Method Summary | |
Number
|
getCurrentPages()
Inquiry method that gets the current number of nonempty logical pages needed to show the rows in the data table. |
Number
|
getDisplayedPage()
Inquiry method that gets the number of the logical page currently displayed. |
Number
|
getMaxDynaRows()
Inquiry method that gets the maximum number of visible rows allowed in the screen table. |
Number
|
getMetapushSortField()
Inquiry method that gets the index of the field currently used as sort field, if available. |
String
|
getMetapushSortFieldName()
Inquiry method that gets the name of the field currently used as sort field, if available. |
void
|
goToPage(<Number> pageNumber)
Operation method that shows a particular logical page in the data table. |
boolean
|
isCommaAsDecimalSeparator()
Inquiry method that gets the type of interpretation to be used to parse the sort field values in order to perform numeric sort. |
boolean
|
isDescendingSort()
Inquiry method that gets the sort direction currently configured. |
boolean
|
isNumericSort()
Inquiry method that gets the type of sort currently configured. |
void
|
onChangingValues(<DOMElement> domNode, <VisualUpdateInfo> updateInfo)
Event handler that is called by Lightstreamer each time a row of the data table, containing the values of the fields for a key, has been added (because of an ADD command) or changed (because of an UPDATE command). |
void
|
onCurrentPagesChanged(<Number> numPages)
Event handler that receives the notification that the number of logical pages has changed. |
void
|
setAutoScroll(<String> type, <String> elementId)
Setter method that enables or disables the automatic adjustment of the screen table scrollbars at each new update. |
void
|
setMaxDynaRows(<Number> maxDynaRows)
Setter method that sets the maximum number of visible rows allowed in the screen table. |
void
|
setMetapushFields(<Number> commandPos, <Number> keyPos)
Setter method that configures the special metapush fields. |
void
|
setMetapushSort(<FieldDescriptor> sortField, <boolean> descendingSort, <boolean> numericSort, <boolean> commaAsDecimalSeparator)
Setter method that configures the sorting policy of the data 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 |
DynaMetapushTable(<GroupDescriptor> tGroup, <SchemaDescriptor> tSchema, <String> tSubscriptionMode)
tGroup
- A group descriptor object, which identifies the items that provide the data table rows. Usually, the group consists of just one item, whose updates are commands that specify whether to ADD, UPDATE or DELETE data table rows. If the group consists of more than one item, then the updates for the different items are simply mixed and concur to the maintenance of the same data table. However, if the same key is used by different items, it refers to distinct rows on the data table. tSchema
- A schema descriptor object, which identifies the fields that represent the data table columns. An Array of field names or a String schema identifier can also be used directly, instead of a schema descriptor object. tSubscriptionMode
- the subscription mode for the items, required by Lightstreamer Server. This kind of data table is suited for COMMAND mode.
Method Detail |
Number getCurrentPages()
Number getDisplayedPage()
Number getMaxDynaRows()
Number getMetapushSortField()
String getMetapushSortFieldName()
void goToPage(<Number> pageNumber)
pageNumber
- The number of the logical page to be displayed. The request is accepted even if the supplied number is higher than the number of currently available logical pages, by displaying an empty logical page, that may become nonempty as soon as enough rows are added to the data table.
boolean isCommaAsDecimalSeparator()
boolean isDescendingSort()
boolean isNumericSort()
void onChangingValues(<DOMElement> domNode, <VisualUpdateInfo> updateInfo)
domNode
- The DOM pointer to the HTML row involved. The row element has been created by Lightstreamer, by cloning the template row supplied through PushPage.addTable(). Note that the HTML cells contained in the row element should not be accessed, as they are reserved to Lightstreamer.
updateInfo
- a value object containinig the updated values for all the fields, together with the formatted values and the display settings for the fields. The desired settings can be set in the object, to substitute the default settings, before returning. void onCurrentPagesChanged(<Number> numPages)
numPages
- The current total number of logical pages.
void setAutoScroll(<String> type, <String> elementId)
type
- The auto-scroll policy. Permitted values are: elementId
- The ID of the HTML element whose scrollbar should auto-scroll, if the type argument is "ELEMENT"; not used, otherwise.
void setMaxDynaRows(<Number> maxDynaRows)
maxDynaRows
- The maximum number of visible rows allowed, or the string "unlimited", to mean that the screen table is allowed to grow without limits, without the need for paging (the check is case insensitive).
void setMetapushFields(<Number> commandPos, <Number> keyPos)
commandPos
- 1-based index of the "command" field.
keyPos
- 1-based index of the "key" field.
void setMetapushSort(<FieldDescriptor> sortField, <boolean> descendingSort, <boolean> numericSort, <boolean> commaAsDecimalSeparator)
sortField
- a field descriptor object for the field to be used as sort field, or null to disable sorting. A String field name or a Number representing a field position can also be used directly, instead of a field descriptor object.
descendingSort
- [Optional] true or false to perform descending or ascending sort. This parameter is optional; if missing or null, then ascending sort is performed.
numericSort
- [Optional] true or false to perform numeric or alphabetical sort. This parameter is optional; if missing or null, then alphabetical sort is performed.
commaAsDecimalSeparator
- [Optional] true to specify that sort field values are decimal numbers in which the decimal separator is a comma; false to specify it is a dot. This setting is used only if numericSort is true, in which case it is optional, with false as its default value.
|
HTML Client 5.0.1 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |