PC SOFT

ONLINE HELP
 WINDEVWEBDEV AND WINDEV MOBILE

Home | Sign in | English EN

  • Type of iteration
  • Handling the controls bound to a data file via properties
  • Modifying the properties of an iteration through a control based on a data file
  • Memory table
  • List Box and Combo Box control populated programmatically
  • Limitations
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
For controls, the BrowsedItem property is used to:
  • Get the item used to automatically loop through controls based on a data file.
  • Change the item used to automatically loop through controls based on a data file. Then, the iteration is reinitialized.
For a report based on a file, the BrowsedItem property is used to change the item used to loop through the data file. In this case, this property can only be used in the "Opening" event of the report.
Remark: This item is defined when creating the control or the report. This item can be modified in the "Data" tab of the element description.
Example
// -- Opening code of the report
// Change the file to loop through
RPT_Report1.SourceName = Customer
// New browse item for "Customer" file
RPT_Report1.BrowsedItem = CustomerID
WINDEVWEBDEV - Server codeJavaUser code (UMC)Ajax
// Ascending sort on the names of companies
TABLE_CustomerTable.BrowsedItem = "-Company"
Syntax

Getting the item used for the automatic iteration in a control based on a data file Hide the details

<Browsed item> = <Control used>.BrowsedItem
<Browsed item>: Character string
Name of the item used to automatically loop through the specified control. This item belongs to the data file the control is based on (returned or modified by the BrowsedFile property).
If the "-" sign is used before the item name, the iteration is performed in descending order.
<Control used>: Control name
Name of the control to be used.

Changing the item used for the automatic iteration in a control based on a data file Hide the details

<Control used>.BrowsedItem = <New item>
<Control used>: Control name
Name of the control to be used.
<New item>: Character string
Name of the new item that will be used to automatically loop through the specified control. This item must belong to the data file the control is based on (returned or modified by the BrowsedFile property)..
If the "-" sign is used before the item name, the iteration is performed in descending order.
WINDEVWEBDEV - Server codeReports and QueriesUniversal Windows 10 AppiPhone/iPadUser code (UMC)PHPAjax

Getting the item used for the automatic iteration in a report based on a data file Hide the details

<Browsed item> = <Report used>.BrowsedItem
<Browsed item>: Character string
Name of the item used to automatically loop through the specified report. This item belongs to the data file the report is based on (returned or modified by the SourceName property).
<Report used>: Name of the report
Name of the report based on a data file to be used.
WINDEVWEBDEV - Server codeReports and QueriesUniversal Windows 10 AppiPhone/iPadUser code (UMC)PHPAjax

Changing the item used for the automatic iteration in a report based on a data file Hide the details

<Report used>.BrowsedItem = <New item>
<Report used>: Name of the report
Name of report based on a data file to be used.
<New item>: Character string
Name of the new item used to automatically loop through the specified report. This item must belong to the data file the report is based on (returned or modified by the SourceName property).
Remarks

Type of iteration

  • Automatic iteration: The data file is automatically looped through and the data is displayed. No specific programming is required.
    The sort is performed on the search item defined in the "Content" tab of the object description. If a filter is specified ("Filter on the search item" in the "Content" tab of the object description), this filter is used. No iteration process is executed for the specified object.
  • Programmed iteration: The developer must define how to loop through the data file and how to display data in the Table control.
    The "Read the first record", "Read the previous record", "Read the next record" and "Read the last record" processes are run. A programmed iteration allows you to sort and filter records with precision. However, a programmed iteration is slower and more complex than an automatic iteration.

Handling the controls bound to a data file via properties

  • The records displayed in a control bound to a file come from the data file or from the query specified with the BrowsedFile property.
  • The sort direction is defined by the BrowsedItem property.
  • The records can be filtered using the Filter property or the HFilter function.

Modifying the properties of an iteration through a control based on a data file

To modify the BrowsedItem, Filter and BrowsedFile properties, it is recommended to:
  1. Stop the iteration by assigning an empty string ("") to the BrowsedFile property.
  2. Modify the relevant properties.
  3. Restart the iteration with the BrowsedFile property.
This method is used to optimize the modifications performed. Indeed, each one of the modifications performed individually restarts the iteration. These operations can become quite slow when they are performed on large data files.

Memory table

If a Table control populated programmatically must display data coming from a data file, a query or a view:
  • Create a Table control populated programmatically in the editor.
  • In the code of the application, specify the item to loop through with the BrowsedItem property. This item must belong to the data file, to the query or to the view whose data will be displayed in the Table control populated programmatically.
  • Use FileToMemoryTable to initialize the Table control with the desired data. The data will be sorted according to the specified search item.
  • The DisplayedItem property will be automatically initialized.

List Box and Combo Box control populated programmatically

If a List Box or Combo Box control populated programmatically must display data coming from a data file, a query or a view:
  • Create a List Box or Combo Box control populated programmatically in the editor.
  • Use FileToMemoryList to initialize the List Box or Combo Box control with the desired data.
  • The BrowsedFile, DisplayedItem, BrowsedItem and StoredItem properties will be automatically initialized.

Limitations

The BrowsedItem property applies only to:
  • the reports whose data source is a data file.
  • the controls (List Box, Table and Combo Box) of a window.
WINDEVAndroidiPhone/iPadJava In a window, the BrowsedItem property applies only to the following controls:
  • Table control.
  • TreeView Table control.
  • List Box control.
  • WINDEV ListView control.
  • Combo Box control.
  • WINDEV Organizer control.
  • WINDEV Scheduler control.
  • WINDEV TreeView control.
  • Internal window control (when swipe gestures are enabled).
WEBDEV - Server codePHP In a page, the BrowsedItem property applies only to the following controls:
  • Table control,
  • Looper control,
  • Linear Looper control,
  • List Box control,
  • Combo Box control,
  • Scheduler control.
Minimum version required
  • Version 9
This page is also available for…
Comments
Click [Add] to post a comment