Class NonVisualTable
Object
|
+--Table
|
+--NonVisualTable
- class
NonVisualTable
- extends Table
Represents a data table that can be fed with real-time data
(delivered by Lightstreamer Server) that are entirely processed and displayed
by custom code. The class contains the subscription details and the event
handlers needed to process the real-time data.
A NonVisualTable is not associated to a screen table. All the
actions that should be triggered by pushed values can only be performed
through the event handlers.
Defined in lspushpage.js
Constructor Summary |
NonVisualTable
(<GroupDescriptor> tGroup, <SchemaDescriptor> tSchema, <String> tSubscriptionMode)
Creates an object to be used to describe a data table whose
visualization on the page is not managed by Lightstreamer.
|
Methods inherited from class Table |
getSchema, getGroup, setDataAdapter, getId, setSelector, setItemsRange, setRequestedMaxFrequency, setRequestedBufferSize, setSnapshotRequired, onItemUpdate, onLostUpdates, onEndOfSnapshot, onStart, getClassName
|
NonVisualTable
NonVisualTable(<GroupDescriptor> tGroup, <SchemaDescriptor> tSchema, <String> tSubscriptionMode)
Creates an object to be used to describe a data table whose
visualization on the page is not managed by Lightstreamer.
The object can be supplied to PushPage.addTable() and
PushPage.removeTable(), in order to bring the data table to
"running" or back to "inactive" state.
Parameters:
tGroup
- A group descriptor object, which identifies the items that provide values for the data table rows. An Array of item names or a String group identifier can also be used directly, instead of a group descriptor object.
Note that, in case a GroupListDescriptor or an array is used, a LiteralBasedProvider or equivalent Metadata Adapter is needed on the Server in order to understand the subscription request.
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.
Note that, in case a SchemaListDescriptor or an array is used, a LiteralBasedProvider or equivalent Metadata Adapter is needed on the Server in order to understand the subscription request.
tSubscriptionMode
- the subscription mode for the items, required by Lightstreamer Server. Permitted values are: - MERGE
- DISTINCT
- RAW
- COMMAND
getUnderlyingSchema
SchemaDescriptor getUnderlyingSchema()
Inquiry method that returns the SchemaDescriptor associated to the second-level data tables.
If setCommandLogic() was not called or was called without the "MULTI" flag null is returned.
If setCommandLogic() was called with a SchemaListDescriptor or an array of strings then a SchemaListDescriptor is returned.
If setCommandLogic() was called with a SchemaIdDescriptor or a string then a SchemaIdDescriptor is returned.
Returns:
The SchemaDescriptor associated to the data table.
setCommandLogic
void setCommandLogic(<boolean> flag, <Number> commandPos, <Number> keyPos, <SchemaDescriptor> underSchema, <String> underDataAdapter)
Setter method that configures the "COMMAND logic" behaviour.
By enabling the "COMMAND logic" behaviour, it is possible to specify
the COMMAND subscription mode and have the data table managed
according to the special values of the "key" and "command" fields.
In particular, in the received update notifications, the update values
will be compared with the previous values with reference to the same key.
If a field name array has been used as schema descriptor for the
data table, then the "command" and "key" field should be included in
the array. If, however, a schema identifier has been used as schema
descriptor, then the positions of these two fields have to be supplied
through this method.
Note that using a different subscription mode is possible, provided that
the special "key" and "command" fields are still available and valued
properly.
Default value: false, i.e. the "COMMAND logic" behaviour
is not enabled.
Lifecycle: The "COMMAND logic" behaviour configuration should
be done before bringing the data table to "running" state through
PushPage.addTable() for the first time.
Parameters:
flag
- true/false to enable/disable "COMMAND logic" behaviour. Setting it to the string "MULTI" enables the "MultiMetapush logic" behavior, which is a two-level extension of the "COMMAND logic" behavior, as explained for the MultiDynaMetapushTable. The updates of the whole two-level data table will be made available through the normal Table.onItemUpdate() event handler and the UpdateItemInfo value objects.
commandPos
- 1-based index of the "command" field. This parameter is only effective when flag is true or "MULTI"; in that case, it is mandatory if a schema identifier has been used as schema descriptor for the table; otherwise, it is optional and a field named "command" will be searched for in the schema.
keyPos
- 1-based index of the "key" field. This parameter is only effective when flag is true or "MULTI"; in that case, it should be supplied if and only if the commandPos parameter is supplied; if not supplied, then a field named "key" will be searched for in the schema.
underSchema
- a schema descriptor object. This parameter is only effective when "MultiMetapush logic" behaviour has been configured (i.e. flag is "MULTI"). It identifies the fields provided by the second-level items (i.e. the fields that represent the columns of the underlying data tables). An Array of field names or a String schema identifier can also be used directly, instead of a schema descriptor object.
Note that the second-level schema must be declared in the same way as the first-level schema (i.e. the schema for the NonVisualTable object). This means that both should be declared as field arrays or both as schema identifiers.
underDataAdapter
- the name of a Data Adapter (within the Adapter Set used by the current session); a null value is equivalent to the "DEFAULT" name. This parameter is only effective when "MultiMetapush logic" behaviour has been configured (i.e. flag is "MULTI"). It identifies the underlying Data Adapter, which supplies all the second-level items. All the possible second-level items should be supplied in "MERGE" mode with snapshot available.
The Data Adapter name is configured on the server side through the "name" attribute of the "data_provider" element, in the "adapters.xml" file that defines the Adapter Set (a missing attribute configures the "DEFAULT" name).
Lightstreamer HTML Client API
Documentation generated by
JSDoc on Tue May 22 11:46:54 2012