Package | com.lightstreamer.as_client.events |
Class | public class NonVisualItemUpdateEvent |
Inheritance | NonVisualItemUpdateEvent TableItemEvent TableEvent flash.events.Event |
Dispatched whenever an update pertaining to an item in the NonVisualTable reaches the client. It reports all the new and old values of the fields, though it does not allow you to alter the values received from the Server.
If the involved table behaves with a "COMMAND logic", then the old values for the current update are meant as relative to the specific key received with the update. The concepts of "first update" and "changed value" are also meant accordingly.
Moreover, if the involved table behaves in "MultiMetapush logic", then each update may be associated with either a first-level or a second-level item. In this case, the reported fields are always the union of the first-level and second-level fields and each single update can only change either the first-level or the second-level fields (but for the "command" field, which is first-level and is always set to "UPDATE" upon a second-level update); note that the second-level field values are always null until the first second-level update occurs).
With "MultiMetapush logic" behaviour, in all methods where a field descriptor has to be supplied, the following convention should be followed:
Property | Defined By | ||
---|---|---|---|
item : * [read-only]
The item name or item index which this event is related to. | TableItemEvent | ||
key : String [read-only]
Only in case the related data table behaves in "MultiMetapush logic",
this property provides the value of the key involved in the update. | NonVisualItemUpdateEvent | ||
numFields : uint [read-only]
The number of fields received from the Server
with the current update. | NonVisualItemUpdateEvent | ||
table : Table [read-only]
The table which this event is related to. | TableEvent |
Method | Defined By | ||
---|---|---|---|
getFieldValue(field:*):*
Inquiry method that gets the current value for a specified field. | NonVisualItemUpdateEvent | ||
getOldFieldValue(field:*):*
Inquiry method that gets the value for a specified field as it was
after the previous update.
If the involved table has been subscribed to by specifying
binary encoding, then the returned object is the result of the
deserialization of an AMF representation supplied by the Data
Adapter, hence it can be of any type; otherwise it will be a String.
| NonVisualItemUpdateEvent | ||
isFieldChanged(field:*):Boolean
Inquiry method that asks whether the current update from the Server
causes the value for a field to change.
If the current update is the first one for the item,
then the values are always considered as changing.
| NonVisualItemUpdateEvent |
Constant | Defined By | ||
---|---|---|---|
NON_VISUAL_ITEM_UPDATE : String = nonVisualItemUpdate [static]
Define the value of the type property of a NonVisualItemUpdate event object. | NonVisualItemUpdateEvent |
key | property |
key:String
[read-only] Only in case the related data table behaves in "MultiMetapush logic", this property provides the value of the key involved in the update. Otherwise, the property value is null.
public function get key():String
numFields | property |
numFields:uint
[read-only]
The number of fields received from the Server with the current update. The value, however, is the same across all updates pertaining to the same item, because it is determined by the schema associated to the item at subscription. The fields received from the Server are always associated to consecutive field numbers starting from 1.
Only in case the related data table behaves in "MultiMetapush logic", it may not be possible to determine the correct number of fields of the data table. This only happens when a schema identifier is used as the schema descriptor for the second-level schema and no update for any second-level item has been received yet. In this case, the property value is 0.
public function get numFields():uint
getFieldValue | () | method |
public function getFieldValue(field:*):*
Inquiry method that gets the current value for a specified field. The value may have changed because of the current update.
If the involved table has been subscribed to by specifying binary encoding, then the returned object is the result of the deserialization of an AMF representation supplied by the Data Adapter, hence it can be of any type; otherwise it will be a String.
Parameters
field:* — String field name or a Number representing a field position.
|
* — The current value. Note that null is a possible value.
|
getOldFieldValue | () | method |
public function getOldFieldValue(field:*):*
Inquiry method that gets the value for a specified field as it was after the previous update.
If the involved table has been subscribed to by specifying binary encoding, then the returned object is the result of the deserialization of an AMF representation supplied by the Data Adapter, hence it can be of any type; otherwise it will be a String.
Parameters
field:* — String field name or a Number representing a field position.
|
* — The previous value. Note that null is a possible value;
null is also returned if the current update is the first one for the item.
|
isFieldChanged | () | method |
public function isFieldChanged(field:*):Boolean
Inquiry method that asks whether the current update from the Server causes the value for a field to change.
If the current update is the first one for the item, then the values are always considered as changing.
Parameters
field:* — String field name or a Number representing a field position.
|
Boolean — true if the value has changed; false otherwise.
|
NON_VISUAL_ITEM_UPDATE | Constant |
public static const NON_VISUAL_ITEM_UPDATE:String = nonVisualItemUpdate
Define the value of the type property of a NonVisualItemUpdate event object.