Click or drag to resize

DataServer.Notify Method (Typed)

X#
An event handler that responds to events that have occurred in methods of this server, or in other servers that are linked to this server in some way. The standard implementation notifies all the server's clients of the event. Description
Important! This method is automatically called by the various action methods of the data server, and should normally not be called by application code.

Namespace:  XSharp.VO.SDK
Assembly:  XSharp.VOSystemClasses (in XSharp.VOSystemClasses.dll) Version: 2.19
Syntax
 VIRTUAL METHOD Notify(
	kNotification AS LONG,
	 uDescription AS USUAL
) AS USUAL
Request Example View Source

Parameters

kNotification
Type: Long
Identifies the event, specified as one of the following constants:
uDescription
Type: Usual
Used only with some notification types.

Return Value

Type: Usual
SELF, except if NOTIFYINTENTTOMOVE is specified for kNotifyName. In this case, the return value is TRUE if successful; otherwise, FALSE.
Remarks
Identifies the event, specified as one of the constants in the table below.Used only with some notification types. See descriptions in the table below
Remarks
ConstantDescription
NOTIFYAPPEND A blank record has been appended to the server; the server is still positioned on this new record, and its values have not been finalized.
NOTIFYCLEARRELATIONNot sent to a data browser.
NOTIFYCLOSEThe server intends to close itself.
NOTIFYCOMPLETION The server has completed some large operation that did not involve repositioning of the server or change to the data (such as reindexing). This gives clients a chance to update visual indication to the user that some operation has been completed.
NOTIFYDELETEThe current record has been deleted, and the server is now positioned according to its rules for how a deletion is handled. The browser should refresh its display accordingly.
NOTIFYFIELDCHANGE A field has changed. uDescription is the field name as a symbol. Note that the browser might not contain a column with the indicated name. The server knows only that it has a field of that name and that it changed, and it notifies all its clients in case they are interested.
NOTIFYFILECHANGE The server has executed some method that perform many changes to the data; all the browser's knowledge about the server and its data is potentially obsolete, and it should refresh all information from the server and all calculations that depend on the data or its position.
NOTIFYGOBOTTOM The server has moved to its last record. Many clients treat this merely as a record change, but the data browser can treat a positioning-to-the-end as a special case.
NOTIFYGOTOP The server has moved to its first record. Many clients treat this merely as a record change, but the data browser can treat a positioning-to-the-top as a special case.
NOTIFYINTENTTOMOVE The server intends to make a move. (Note that the move may have been initiated by another client.) The browser should make sure that all its data is saved, if necessary, before the movement is done. The standard implementation checks validation status. If the browser contains data that is invalid, the user has a choice of correcting the errors or discarding the data.
NOTIFYRECORDCHANGE The record position of the server has changed. All clients are notified after any movement, so they can refresh their displays from the server. A browser needs to update its display intelligently, depending on how far the move was. uDescription might indicate the length of the move (the number of records). The browser can use this information for display optimization, but cannot rely on its availability.
NOTIFYRELATIONCHANGE Not sent to a data browser (relation changes among servers are transmitted to clients as file changes).
This Notify() method is at the heart of the automatic notification among linked browsers and servers, allowing any window to make a change to a field value or initiate a movement and also ensuring that all client windows reflect the change.
Any class that is registered as a client of a server must respond intelligently to the Notify message.
As always with defined constants, you should never rely on the actual values of the constants—they will not necessarily stay the same. However, the constants do maintain their order:
  • NOTIFYFIELDCHANGE - Lowest
  • NOTIFYCLOSE - .
  • NOTIFYCOMPLETION - .
  • NOTIFYINTENTTOMOVE - .
  • NOTIFYRECORDCHANGE - .
  • NOTIFYGOBOTTOM - .
  • NOTIFYGOTOP - .
  • NOTIFYDELETE - .
  • NOTIFYAPPEND - .
  • NOTIFYFILECHANGE - .
  • NOTIFYRELATIONCHANGE - .
  • NOTIFYCLEARRELATION - Highest
Thus, you can reliably write:
X#
1IF  kNotification > NOTIFYINTENTTOMOVE;
2.AND. kNotification < NOTIFYFILECHANGE
3... // Only record level moves
4ENDIF
See Also