ONLINE HELP
 WINDEVWEBDEV AND WINDEV MOBILE

Help / How to proceed? / Windows, pages and controls
  • Data source of type Data File
  • Data source of type Query
  • Data source of type Array
  • No 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
A data source allows you to easily populate a control with little or no code. Different types of data sources are available:
Data source of type Data File
If the data source of a control is a data file, the control is linked to that data file in the analysis.
For example, the columns of a Table, List Box or Combo Box control or the attributes of a Looper control are bound to the items in the data file.
This population method doest not require any code: the data file is automatically looped through in the direction of the selected search key.
Two types of access are available:
  • Direct access to the data source: no limit regarding the volume of data (number of records). The records are displayed by page. Only the records corresponding to the rows displayed in the controls are read.
  • In-memory data source: the maximum number of rows must be specified in order to limit memory usage. The load time in memory can be quite long if the number of rows exceeds 100 000.
Features specific to Table controls:
  • Only the columns bound to key items in the data file can be sorted and filtered,
  • No programming.
For more details, see:
Data source of type Query
There are two methods to define a query as data source:
  • Defining the query in the query editor and associating it with the control (as with a data file),
  • Using an embedded query: the query is created when the control is created. In this case, the query cannot be used in another control.
The columns of a Table, List Box or Combo Box control or the attributes of a Looper control can be bound to the items in the query.
This population method does not require any code. The query is automatically looped through. It is recommended to keep the sort in automatic mode as the data is already sorted in the query (faster). You can choose a different sorting condition: in this case, the longest process will be the loading of the query.
For a query with parameters, the initialization code of the control must be used to initialize the values of different parameters.
Population mode:
  • If you choose a direct access to the data source, there is no limit regarding the volume of data that can be loaded (number of records). The records are displayed by page. Only the records corresponding to the rows displayed in the controls are read.
  • If you choose the in-memory data source, you need to specify the maximum number of rows in order to limit memory usage. The load time in memory can be quite long if the number of rows exceeds 100 000. In this case, it is recommended to define selection conditions in the query to avoid long loading times.
Useful information about the Table control:
  • All columns can be sorted and filtered.
  • No programming.
Data source of type Array
An Array defines an Array variable. The Array can be:
  • simple: string, date, numeric, etc.
  • based on a structure. In this case, the structure is similar to the structure of a file record.
    The Array must be populated programmatically beforehand.
    The data can come from:
    • a data file,
    • several data files,
    • a query.
The Array variable must be global either to the project, to the window or to the page to be associated with the control.
As with a data file or query, the columns of a Table, List Box or Combo Box control or the attributes of a Looper control are bound to the members of the Array structure.
This population method does not require any code. The Array is automatically looped through from the first to the last element (depending on how it is sorted).
Useful information about the Table control:
  • All columns can be sorted and filtered.
  • Very little programming.
No data source
In this mode, the control is not bound to a data source. The population method must be programmed by looping through the data file, query or Array variable using different WLanguage functions:
  • HRead, ... FOR EACH ... for data files or queries,
  • FOR ... , FOR EACH ELEMENT OF... for Arrays.
You must call the WLanguage functions used to write to the corresponding control:
  • Table control: TableAdd, TableAddLine...
  • List Box control: ListAdd...
  • Combo Box control: ListAdd...
  • Looper control: LooperAdd, LooperAddLine, ...
This population method allows developers to define everything programmatically. Therefore, it is necessary to become familiar with the different WLanguage functions for managing data files, queries, arrays and structures.
Minimum version required
  • Version 9
This page is also available for…
Comments
Click [Add] to post a comment

Last update: 08/25/2022

Send a report | Local help