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
  • Populating the control at the top and/or bottom
  • 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:
      • WINDEV Mobile "Populate at the bottom": The data will be added automatically below the existing data.
      • New in version 2025
        WINDEV Mobile "Populate at the top": Data will be added automatically at the top of the control, above 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.
        • WINDEV Mobile In WINDEV Mobile, the internal window is named "IW_AddExtraElem_WM".
        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:
  • WINDEV Mobile In WINDEV and WINDEV Mobile:
    • Add additional elements at the bottom.
    • New in version 2025
      Add additional elements at the top.

Limitations

You cannot use the infinite data loading mode for:
  • Horizontal Looper, data-bound Looper and multi-column Looper controls.
  • Data-bound Table controls.

Customizing the loading window or page

The progress bar is contained in an internal window or page.
WINDEV Mobile A standard internal window is used by default, but you can integrate it into the project to customize it. The progress bar is automatically managed. The internal window used must contain a single infinite Progress Bar control.
"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.
New in version 2025
WINDEV Mobile
Populating the control at the top and/or bottom
You can define the following modes for both Table and Looper controls:
  • populate at the bottom. In this case, rows are added at the end of the control, using the following functions:
    LooperAddIWAdds a row as an internal window at the end of a Looper control populated programmatically.
    LooperAddLineAdds a row at the end of a Looper control.
    TableAddLineAdds a row in:
    • a Table control,
    • a TreeView Table control.
    The loading window is displayed at the bottom of the control. This was the only mode available until version 2024.
  • populate at the top. In this case, new rows are added before the existing rows, using the following functions:
    New in version 2025
    LooperAddBeginning
    Adds a row at the beginning of an Infinite Looper control. The row is inserted before the first row in the Looper control. The scrollbar of the Looper control remains at the same position.
    New in version 2025
    LooperAddIWBeginning
    Adds a row consisting of an internal window at the beginning of an Infinite Looper control. The row is inserted before the first row in the Looper control. The scrollbar of the Looper control remains at the same position.
    New in version 2025
    TableAddBeginning
    Adds a row at the top of an Infinite Table control. The row is inserted before the first row of the Table control. The scroll position of the Table control doesn't change.
    These functions do not modify the position of the selected item. Scrollbar control position remains unchanged. The loading window is displayed at the top of the control.
There are are two WLanguage events that differentiate these data loading modes:
  • Add additional elements at the top. This event is called when the user scrolls up.
  • Add additional elements at the bottom. This event is called when the user scrolls down.
You can also add elements at the top and at the bottom. In this case:
  • The loading window can be displayed simultaneously at the top and at the bottom. In both cases, the same window is used.
  • If the Table or Looper control is empty and has no scrollbar after being opened or resized, the "Add additional elements at the bottom" event is executed.
Note: The functions TableAddInProgress and LooperAddInProgress take into account the filling mode and allow you to manage both the patience window displayed at the top of the field and the one displayed at the bottom.
WINDEV Mobile Important: A control cannot be populated at the top if the pull-to-refresh functionality is enabled (and vice versa).
Programming
WINDEV Mobile The following functions are used to manipulate Infinite Table and Infinite Looper controls:
New in version 2025
LooperAddBeginning
Adds a row at the beginning of an Infinite Looper control. The row is inserted before the first row in the Looper control. The scrollbar of the Looper control remains at the same position.
LooperAddInProgressGets or sets the display mode of the internal loading window used when additional elements are loaded in an Infinite Looper control.
New in version 2025
LooperAddIWBeginning
Adds a row consisting of an internal window at the beginning of an Infinite Looper control. The row is inserted before the first row in the Looper control. The scrollbar of the Looper control remains at the same position.
New in version 2025
TableAddBeginning
Adds a row at the top of an Infinite Table control. The row is inserted before the first row of the Table control. The scroll position of the Table control doesn't change.
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: 02/16/2025

Send a report | Local help