Packagecom.lightstreamer.as_client.events
Classpublic class NonVisualItemUpdateEvent
InheritanceNonVisualItemUpdateEvent Inheritance TableItemEvent Inheritance TableEvent Inheritance 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:



Public Properties
 PropertyDefined By
 Inheriteditem : *
[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
 Inheritedtable : Table
[read-only] The table which this event is related to.
TableEvent
Public Methods
 MethodDefined 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
Public Constants
 ConstantDefined By
  NON_VISUAL_ITEM_UPDATE : String = nonVisualItemUpdate
[static] Define the value of the type property of a NonVisualItemUpdate event object.
NonVisualItemUpdateEvent
Property Detail
keyproperty
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.


Implementation
    public function get key():String
numFieldsproperty 
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.


Implementation
    public function get numFields():uint
Method Detail
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.

Returns
* — 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.

Returns
* — 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.

Returns
Boolean — true if the value has changed; false otherwise.
Constant Detail
NON_VISUAL_ITEM_UPDATEConstant
public static const NON_VISUAL_ITEM_UPDATE:String = nonVisualItemUpdate

Define the value of the type property of a NonVisualItemUpdate event object.