ONLINE HELP
 WINDEVWEBDEV AND WINDEV MOBILE

Help / Developing an application or website / Controls, windows and pages / Controls: Available types / Table control / Table based on a data file
  • Overview
  • Table control based on a data file updated automatically
  • Table control based on a data file updated programmatically
WINDEV
WindowsLinuxJavaReports and QueriesUser code (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Browser code
WINDEV Mobile
AndroidAndroid Widget iPhone/iPadIOS WidgetApple WatchMac Catalyst
Others
Stored procedures
Linking a Table control to a data file or query
ODBCNot available with this kind of connection
Overview
Table controls display the content of a data file or query: users can select one or more records from this data file or query.
A Table control can be linked to:
  • an existing query: you just have to select the desired query from your project's queries.
  • a query included in the Table control: this query is created in the Table control creation wizard. This query will be available for this control only.
When a Table control is linked to a data file or query, the control can be updated with the data from the data file:
  • automatically: No specific code is required to update the Table control. The options to loop through the data file linked to the control can be defined in the "Content" tab of the Table control description.
  • programmatically: The code used to loop through the data file linked to the Table control must be entered in the different events of the Table control. This method is not recommended.
    AndroidiPhone/iPad This method is not available.
Remark: When creating a Table control, the wizard prompts the users to enter the necessary information to link the control to a data file or query.
Table control based on a data file updated automatically
A Table control based on a data file displays data from a specific data source (data file, query, etc.).
The content of the Table control is defined when it is created and can be modified in the description window ("Content" tab).
In this window, you can define whether the Table control is based on a data file or is populated programmatically. For a Table control based on a data file, you can define how to loop through the data source:
  • Browsed file
File or query containing the data to display.
If the Table control is based on an embedded query, the name of the browsed file has the following format: <Window Name>_<Number>$Query. In this case, all the options of the "Embedded query" button are available.
  • Stored item (optional)
Item whose value is returned to the program when a row is selected in the Table control.
  • Browse automatically (described below)
If this option is checked, the runtime engine iterates over the file and displays the data in the Table control. No WLanguage code is required.
  • Browse item
Item used to loop through the data source. The records displayed in the Table control are sorted based on this item.
If <Automatic> is selected, the HFSQL engine automatically selects the best search key.
  • Reverse browse (descending)
The iteration direction depends on the browse item. The iteration direction is defined in the data model editor, in the characteristics of the item.
If this option is checked, the iteration direction used will be the opposite of the one defined in the data model editor.
  • Display the records whose browse item starts with
Condition used to filter the displayed records. This is a "Start with" filter and is applied to the browse item. To implement more complex filters, use HFilter. For more details on filters, see Filter in Table controls based on a data file.
Android Filter options are not available for Table controls with direct access to the data source.
WINDEV Display the content while moving the scrollbar
If this option is checked, the size of the vertical scrollbar cursor will be proportional to the number of elements in the Table control.
WINDEVWINDEV Mobile Use HFilter to browse the file
Allows you to filter the records displayed in the Table control and the base data file of the control. For more details on this option, see Filter in Table controls based on a data file.
Android Filter options are not available for Table controls with direct access to the data source.
WINDEV Synchronize the display (HFSQL C/S)
This option automatically refreshes the Table control based on a data file as soon as the associated Client/Server HFSQL data file is modified.
WINDEV Show row details with [ + ]
This option allows you to expand a row in the Table control to see records from other data files that are bound to the selected row.
Table control based on a data file updated programmatically
If you use a Table control based on a data file with programmed initialization, the code to loop through the data file must be entered in the different events associated with the control. This method is not recommended and is only kept for backward compatibility.
For example: Initialization of a Table control with the customers of the CUSTOMER data file.
// Initialize the Table control
HReadFirst(CUSTOMER, NAME)
 
// Previous record
HReadPrevious(CUSTOMER, NAME)
// Next record
HReadNext(CUSTOMER, NAME)
// Last record
HReadLast(CUSTOMER, NAME)
Minimum version required
  • Version 9
This page is also available for…
Comments
Click [Add] to post a comment

Last update: 09/15/2024

Send a report | Local help