
With the RecView and the RecList, conzept 16 provides two objects with which data records of a table can be displayed very easily. Depending on the processing within the application, however, the data records that are to be displayed there change. In this case, it is essential to update the display objects. There are a number of update options available to the developer. In the following article, we would like to give you a brief insight into these options.

The RecList object is optimized for displaying large tables. As a result, it is not possible to keep all existing data records in the working memory. For this reason, the RecList only keeps the visible records in the working memory (see Fig. 1).
The displayed records are read from the table record by record. The data records are read via the global data record buffer (analogous to RecRead()
). This results in the field buffer values changing as a result of the display.
The mechanism described also applies to scrolling. Sentences are read according to the scroll direction.
If a line is selected in the RecList, not all fields of the data record buffer are filled with new values, but only those that are also entered in the RecList.
The following describes tasks and how they can be implemented using WinUpdate()
:
Task definition: Data records are displayed in a RecList. These records are now processed within the application. The data records that are to be displayed in the RecList change as a result of processing. The RecList must now be updated so that these data records are also visible within the RecList object. The data record already selected before processing should remain selected. This data record should also retain its position within the RecList.
tHdlRecLst->WinUpdate(_WinUpdOn, _WinLstFromSelected |
_WinLstRecDoSelect |
_WinLstPosSelected);
Explanation: The first option in the above excerpt is _WinLstFromSelected
, which causes the RecList to be rebuilt based on the selected data set. The _WinLstRecDoSelect
option gives the focus to the data record within the RecList that is currently in the field buffer. As the previously selected data record is still in the field buffer at this point, it will continue to be selected. Finally, _WinLstPosSelected
is specified. As a result, the previously selected record retains its position within the list when the object is rebuilt.
Task definition: Data records are displayed in a RecList object. Within the list, the last data record should be displayed selected after processing, even if it is not in the visible area of the list at the time of processing. To do this, the record with the largest key value must be loaded via RecRead(_RecLast)
. Based on the buffer content, an update to the RecList must then be carried out and the current data record selected.
If the displayed data records are already sorted out according to a criterion in the EvtLstRecControl
event, the last data record of the table must also be read and an update to the RecList must be carried out based on the buffer content. The RecList itself then determines whether this data record is displayed. If this is not the case, the data record with the next smallest key value is loaded. The system now checks again whether this data record is displayed. This is repeated until a data record is found that is displayed.
tRes # RecRead(tHdlRecLst>wpDbFileNo,
tHdlRecLst->wpDbKeyNo, _RecLast);
tHdlRecLst->WinUpdate(_WinUpdOn, _WinLstRecFromBuffer |
_WinLstRecDoSelect);
Explanation: The option _WinLstRecFromBuffer
ensures that the list is rebuilt starting from the value of the field buffer and _WinLstRecDoSelect
focuses on this data record within the list.
Task definition: A specific data record is to be selected in a RecList. As a further condition, the data record is to be displayed at the bottom of the list. To accomplish this, it is not necessary to read the data set first and position it based on the buffer content. Here, access can be made via a specific key value; the corresponding value must be assigned to the key field. The prerequisite here is that the key matches the key specified in the wpDbKeyNo
property.
// Article with article number 20034 is to be selected
ART.iNummer # 20034;
tHdlRecLst->WinUpdate(_WinUpdOn,
_WinLstRecFromBuffer|
_WinLstRecDoSelect |
_WinLstPosBottom);
Explanation: The update process here is similar to the previous example. The additionally specified option _WinLstPosBottom
causes the data record in the field buffers to be positioned at the end of the visible area of the RecList.