FormDataSource.cursorNotify Method

Notifies the application about a cursor event.

public void cursorNotify(int event)

Run On

Client

Parameters

Parameter

Description

event

The cursor event identifier. The following table shows the available cursor events.

Event Event ID
CURSOR_CACHESIZE 0
CURSOR_ALLLOADED 1
CURSOR_CLEAR 2
CURSOR_POSITION 3
CURSOR_INSERT 4
CURSOR_UPDATE 5
CURSOR_DELETE 6
CURSOR_LEAVERECORD 7
CURSOR_CACHESIZE_INSERTFRONT 8

Remarks

This method can be overridden to implement custom handling of cursor events. However, super() needs to be called first to allow the kernel to handle the event, as appropriate.

Example

The following example demonstrates handling of the CURSOR_CACHESIZE and CURSOR_ALLOADING events (event IDs 0 and 1).

public void cursorNotify(int _event)
{
    VendTransOpen   vendTransOpenCache;
    Set             setRefId;
    ;
    super(_event);
    if (_event == 0 || _event == 1)
    {
        setRefId = new Set(typeId2Type(typeid(recId)));
        vendTransOpenCache = vendTransOpen_DS.getFirst(0,false);
        while (vendTransOpenCache)
        {
            setRefId.add(vendTransOpenCache.RecId);
            vendTransOpenCache = vendTransOpen_DS.getNext();
        }
        if (setRefId.elements())
        {
            specOffsetVoucher.setCacheSpecTrans(
                tablenum(VendTransOpen),
                Map::create(Specification::specTransFillCache(
                    tablenum(VendTransOpen),
                    setRefId.pack())));
        }
    }
}

See Also

FormDataSource Class

FormDataSource.cursor Method

FormDataSource.leave Method