Home | Sign in | English EN
  • Overview
  • How to?
  • Configuring the control
  • Event "Adding additional elements"
  • Customizing the wait window
WindowsLinuxUniversal Windows 10 AppJavaReports and QueriesUser code (UMC)
WindowsLinuxPHPWEBDEV - Browser code
AndroidAndroid Widget iPhone/iPadIOS WidgetApple WatchMac CatalystUniversal Windows 10 App
Stored procedures
There are two methods to populate Table and Looper controls programmatically:
  • Populating the entire control: The entire data found in the control is loaded when initializing the control.
    Advantage: All the values are found in the control. You have the ability to perform searches or sorts on the elements found in the control.
    Drawback: The control and its data can use a lot of memory. For the mobile applications, the full load may consume bandwidth and slow down the display.
  • Populating the control if necessary (infinite Table and Looper): Only the data visible to the user is loaded in memory. The additional data is loaded upon request (when using the scrollbar for example).
    Advantage: Low memory usage. For the mobile applications, increased display speed and reduced bandwidth consumption.
    Drawback: No sort and no search as long as the entire data is not available.
How to?

Configuring the control

To enable the mechanism for filling the control if necessary (Infinite table/Infinite looper):
  1. Open the control description window.
  2. In the "Content" tab, in the "Infinite table"/"Infinite looper" section:
    • Check "Call the process for adding additional elements at the end of scroll".
    • Select the wait internal window displayed when loading additional rows. You can:
      • Use the default wait window,
      • Use the preset window. If this option is selected, the preset internal window is immediately added into the current project and it is associated with the feature.
        Remark: We advise you to copy the window into the directory of current project. In WINDEV, the internal window is named "IW_AddAdditionalElement_WD". In WINDEV Mobile, the internal window is named "IW_AddAdditionalElement_WM".
      • Use an internal window of your project.
    • Specify the maximum number of rows: This number corresponds to the maximum number of rows that can be added to the control. When this number is reached, the "Adding additional elements" event will not be called anymore.
  3. Validate the control description window.
When configuring the infinite Table or Looper control, the "Adding additional elements" event was added into the control events.
Remark: This option is not available for:
  • Looper controls based on a data file, horizontal Looper controls and multi-column Looper controls.
  • the Table controls based on a data file.

Event "Adding additional elements"

The event "Adding additional elements" must contain the code for refreshing data in the control. By default, the internal wait window is displayed while running this code. At the end of code execution, the internal wait window will be automatically hidden.
Remark: 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
  • once the control was enlarged, if all the control rows are visible (while they were not visible before the enlargement).
  • after a scroll to the bottom, if the last control row is visible.
Caution: If the default internal window is selected, a progress bar (wait window) is displayed while running the event "Adding additional elements". This progress bar will be displayed only if the main thread can be run while running the event "Adding additional elements".
To see the progress bar, you must perform the long refresh process (HTTP request or HFSQL browse for example) in a thread run from the event "Adding additional elements". In this case, the progress bar must be managed by TableAddInProgress and LooperAddInProgress.
Code example for the event "Adding additional elements": Filling a Table control with the last unread emails:
nSessionID is int
EmailRead is Email
// Loads the last unread messages
EmailReadFirst(nSessionID,EmailRead, emailUnread)
// Process the message
TableAddLine(TABLE_Email, EmailRead.Sender, EmailRead.ReceiveDate, EmailRead.MessageID)
EmailReadNext(nSessionID,EmailRead, emailUnread)
Remark: If the event "Adding additional elements" returns False :
  • the internal wait window is not displayed anymore,
  • the "Adding additional elements" event is not run anymore.

Customizing the wait window

The progress bar displayed during the load is found in an internal window.
A standard internal window is used by default but it can be included in the project for customization.
The progress bar is automatically managed. The internal window used must contain a single infinite Progress Bar control.
Minimum version required
  • Version 21
This page is also available for…
Click [Add] to post a comment