SQLTable.Notify Method | |
Provide a method that is automatically called by the action methods of the server after completion of some significant event: a column has changed, the server position has changed, some operation has been completed. Its standard implementation is to broadcast the same notification to its attached clients.
Namespace:
VO
Assembly:
VOSQLClasses (in VOSQLClasses.dll) Version: 2.19
Syntax VIRTUAL METHOD Notify(
kNotification,
uDescription
) AS USUAL CLIPPER
[ClipperCallingConventionAttribute(new string[] { ... })]
public override Usual Notify(
Usual kNotification = default,
Usual uDescription = default
)
Request Example
View SourceParameters
- kNotification (Optional)
- Type: Usual
Identifies the event, specified as one of the constants in the table below. - uDescription (Optional)
- Type: Usual
Used only with some notification types. See descriptions in the table below
Return Value
Type:
Usual
TRUE if successful; otherwise, FALSE.
Remarks Constant | Description |
---|
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.
|
NOTIFYCLEARRELATION | Not sent to a data browser. |
NOTIFYCLOSE | The 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.
|
NOTIFYDELETE | The 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:
1IF kNotification > NOTIFYINTENTTOMOVE;
2.AND. kNotification < NOTIFYFILECHANGE
3...
4ENDIF
See Also