ONLINE HELP
 WINDEVWEBDEV AND WINDEV MOBILE

Help / WEBDEV concepts / Part 5 - Databases
  • Table control with direct access to the data source
  • Table control populated programmatically
  • Table control with in-memory data source
WINDEV
WindowsLinuxUniversal Windows 10 AppJavaReports and QueriesUser code (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Browser code
WINDEV Mobile
AndroidAndroid Widget iPhone/iPadIOS WidgetApple WatchMac CatalystUniversal Windows 10 App
Others
Stored procedures
11. Table/Looper controls
Previous pageTable of contentsNext page
Table/Looper controls can be used to display a set of information (e.g., the content of a data file). The content of these controls can come from three different sources:
Remark: These three modes will be explained in detail for the Table control. However, the same concepts apply to the Looper control.
Table control with direct access to the data source
A Table control with direct access to the data source directly displays data from a data file or query. The data file structure is described in the data model editor and the data is entered in the site, for example.
When you loop through the data file, the data is displayed in the Table control. The data file is read for each row displayed: the record read is displayed in a row of the Table control.
The data displayed that is not linked to the data file is lost when the Table control is refreshed (when scrolling, for example).
The number of records displayed in the control can be limited by setting a filter (HFilter used in the control initialization code).
Several WLanguage functions can be used to handle Table controls based on a data file. These functions start with "Table".
To add a record to the Table control, add the record to the corresponding HFSQL data file (using HAdd) and refresh the Table control with TableDisplay.
To delete a record from the Table control, delete the record from the corresponding HFSQL data file (using HDelete) and refresh the Table control with TableDisplay.
Table control populated programmatically
In this case, the Table control directly displays the data loaded in memory. The data is added to the Table control programmatically (with TableAddLine, for example).
When data is in memory, you can perform different actions in the Table control (sort columns, search in columns, etc.).
Table control with in-memory data source
Table controls with in-memory data source combine the advantages of Table controls with direct access to the data source and Table controls populated programmatically.
The Table control is linked to the data file but the entire content of the data file is loaded in memory. Sort and the search features are available for all columns.
The data that is not linked to the data file is not lost when moving the scrollbar (in Check Box columns, for example).
Since the data file records are loaded in memory, this type of control is recommended for data files with less than 100 000 records (to avoid memory overflow).
Remark: The different modes to populate the controls (programmatically, with direct access to the data source and with in-memory data source) are available for different types of controls: List Box, Combo Box, Table, Looper, etc.
Previous pageTable of contentsNext page
Comments
Click [Add] to post a comment

Last update: 10/27/2022

Send a report | Local help