OnBeforeEditItem picture event


Declaration


Global handler:
ENTRY OnBeforeEditItem(IN INT _refId, IN INT _row, _col, RECORD (*STRUCTURE DEFINITION*) _rowData,  BOOL _bAllowEdit)
  ; operations
END OnBeforeEditItem

Special handler:
ENTRY XXX_OnBeforeEditItem(IN INT _row, _col, RECORD (*STRUCTURE DEFINITION*) _rowData,  BOOL _bAllowEdit)
 ; operations
END XXX_OnBeforeEditItem
Parameters
_refIdFor global operation - mandatory input parameter of the Int. type. 
XXXName of the Reference variable connected to the graphic object without the  introductory sign "_".
_row, _colRow, column of a cell of which value needs to be approved.  
_rowDataStructure representing edited row. 
_bAllowEditOutput parameter - allowance indication of value editing. 
Description

The event is generated by the diplayer of the Browser type in the moment before the cell editing beginning. The cell is identified by its row (_row) and column (_col). 

It is used when it is necessary to pre-fill the cell value in the editing window. In such case, a handler sets the cell in the _rowData parameter to the required value. This set value will be pre-filled for the user when starting to edit cells. Setting of the _rowData cell in a column different from _col is ignored. 


If an event handler sets output parameter _bAllowEdit to the @FALSE value, the user will not be allowed to edit a cell. 
If an event handler sets output paramete_bAllowEdit to the @TRUE value, the user will be allowed to edit a cell. 


Example
In the example, there is a displayer event handler of the Browser type with the assigned reference variable _browser and connected structural variable of the SD.Params type that will pre-fill the item "Name". 
 


ENTRY browser_OnBeforeEditItem(IN INT _row, IN INT _col, RECORD (SD.Params) _rowData, BOOL _bAllowEdit)
  IF _row = 1 THEN
    _rowData[1]^Name:= "Name1"
  ENDIF
END browser_OnBeforeEditItem


Global picture event handler:
 


ENTRY OnBeforeEditItem(IN INT _refId, IN INT _row, IN INT _col, RECORD (SD.Params) _rowData, BOOL _bAllowEdit)
  IF _refId = _browser THEN
    IF _row = 1 THEN
      _rowData[1]^Name:= "Name1"
    ENDIF
  ENDIF
END OnBeforeEditItem
Napíšte komentár