ONLINE HELP
 WINDEVWEBDEV AND WINDEV MOBILE

This content has been translated automatically.  Click here  to view the French version.
Help / Developing an application or website / Controls, windows and pages / Controls: Available types / Looper control
  • Overview
  • Table or Looper control settings
  • Implementation
  • Events added
  • Limitations
  • Customizing the loading window or page
  • "Add additional elements" event
  • Programming
WINDEV
WindowsLinuxJavaReports and QueriesUser code (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Browser code
WINDEV Mobile
AndroidAndroid Widget iPhone/iPadIOS WidgetApple WatchMac Catalyst
Others
Stored procedures
Overview
There are two methods to populate Table and Looper controls programmatically:
  • Populating the entire control: All data present in the control is loaded when the control is initialized.
    Advantage: All values are present in the control. You can sort and search the elements contained in the control.
    Disadvantage: The control and its data can use a significant amount of memory. In the case of mobile applications, this full loading mode can be slow and consume unnecessary bandwidth.
  • Populating the control if necessary (infinite Table and Looper): Only data visible to the user is loaded into memory. Additional data is loaded only if the user scrolls the view.
    Advantage: Low memory usage. In the case of mobile applications, this means faster data visualization and lower bandwidth consumption.
    Disadvantage: No sort or search functionalities are available until all data is available.
Table or Looper control settings

Implementation

To choose how additional data will be displayed in infinite Table and Looper controls:
  1. Open the control description window.
  2. On the "Content" tab, in the "Infinite table"/"Infinite looper" section:
    • Choose the infinite table population mode:
      • WEBDEV - Server code "Call the process for adding elements when the user scrolls to the end": Data is added at the bottom. The data will be added automatically below the existing data.
    • Select the internal window or page to be displayed when loading additional rows. You can:
      • Use the default internal loading window or page,
      • Use the preset window or page. If this option is selected, the WDAAF internal component is immediately added to the current project. Depending on the platform, the corresponding element (window or page) is automatically associated with the "Internal loading window" or "Internal loading page" option.
        • WEBDEV - Server code In WEBDEV, the page is named "IPAGE_AddExtraElem".
        Note: If the WDAAF component already exists, only the internal window or page is added to the component.
      • Use an internal window or page from your project.
    • Specify the maximum number of rows: This is the maximum number of rows that can be added to the control. Once this number is reached, the "Add additional elements" event will no longer be called.
  3. Validate the control description window.

Events added

The Table control or Infinite RepeatString setting has added:
  • WEBDEV - Server code In WEBDEV:
    • Add additional elements (browser).
    • Add additional elements (server).
    • Return to browser after adding additional elements in AJAX mode (browser).

Limitations

You cannot use the infinite data loading mode for:
  • Horizontal RepeatString, RepeatString linked to a data file and Multi-column RepeatString fields.
  • Table fields linked to a data file.

Customizing the loading window or page

The progress bar is contained in an internal window or page.
WEBDEV - Server code A standard internal page is used by default, but you can integrate it into the project to customize it. The progress bar is automatically managed.
"Add additional elements" event
The "Add additional elements" event must contain the code for refreshing data in the control. By default, the internal loading window is displayed while running this code. At the end of code execution, the internal loading window will be automatically hidden.
Note: This event is automatically called:
  • when initializing the window, if the control is empty.
  • after the window initialization, if all the control rows are visible
  • after the control is enlarged and all rows become visible.
  • after scrolling down, if the last row is visible.
Note: If the default internal window is selected, a progress bar (loading window) is displayed while the "Add additional elements" event is executed. This progress bar will be displayed only if the main thread can be run while running the "Adding additional elements" event.
To see the progress bar, you must run a long refresh process (HTTP request or HFSQL iteration, for example) in a thread run from the "Add additional elements" event. In this case, the progress bar must be managed using TableAddInProgress and LooperAddInProgress.
Example of code for the "Add additional elements" event:
Fill in a Table control with the last unread emails:
SessionID is int
EmailRead is Email
 
// Loads the last unread messages
EmailReadFirst(SessionID, EmailRead, emailUnread)
WHILE NOT Email.Out
	// Process the message
	TableAddLine(TABLE_Email, EmailRead.Sender, EmailRead.ReceiveDate, EmailRead.MessageID)
	EmailReadNext(SessionID, EmailRead, emailUnread)
END
Note: If the "Add additional elements" event returns False:
  • the internal loading window is no longer displayed,
  • the "Add additional elements" event is no longer executed.
WEBDEV - Server code The same behavior applies.
Programming
WEBDEV - Browser code The following functions are used to manipulate Infinite Table and Infinite Looper controls:
LooperAddInProgressGets or sets the display mode of the internal loading window used when additional elements are loaded in an Infinite Looper control.
TableAddInProgressGets or sets the display mode of the internal loading window used when additional elements are loaded in an Infinite Table control.
Minimum version required
  • Version 21
This page is also available for…
Comments
Click [Add] to post a comment

Last update: 05/29/2025

Send a report | Local help