ONLINE HELP
 WINDEVWEBDEV AND WINDEV MOBILE

This content has been translated automatically.  Click here  to view the French version.
  • Overview
  • How to?
  • Configuring the control
  • Event "Adding additional elements"
  • Customization of the window or Page of patience
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
Overview
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.
    Benefit: 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).
    Benefit: 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 internal patience window (or the internal patience Page) displayed when loading additional lines. It is possible to:
      • Use the internal window/page of patience by Default,
      • Use the pre-defined window/Page. If this option is selected, the WDAAF internal component is immediately added to the current project. Depending on the platform, the corresponding element is automatically associated to the functionality.
        • WINDEV the internal window is called "FI_AddElementSuppl_WD.
        • WINDEV Mobile In WINDEV Mobile, the internal window is named "IW_AddAdditionalElement_WM".
        • WEBDEV - Server code In WEBDEV, the internal Page is called "PI_AjoutElemSuppl".
        Remark: If the Component WDFAA already exists, only the internal window (or the internal page) is added to the Component.
      • Use an internal window/Page 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.
The Table control or Infinite Repeat Zone setting added:
  • WINDEVWINDEV Mobile In WINDEV and WINDEV Mobile: the event "Addition of extra elements" in the control events.
  • WEBDEV - Server code IN WEBDEV: the following events in the control events:
    • Adding additional elements (browser).
    • Adding additional elements (server).
    • AJAX return after adding additional elements (browser).
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 "Adding additional elements" event. 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 perform the long refresh process (HTTP request or HFSQL browse for example) in a thread run from the "Adding additional elements" event. In this case, the progress bar must be managed by TableAddInProgress and LooperAddInProgress.
Code example for the "Adding additional elements" event: Filling a Table control with the last unread emails:
IdSession is int
EmailLu is Email
 
// Charge les derniers messages non lus
EmailReadFirst(IdSession, EmailLu, emailUnread)
WHILE NOT Email.Out
// Traitement du message
TableAddLine(TABLE_Email, EmailLu.Sender, EmailLu.ReceiveDate, EmailLu.MessageID)
EmailReadNext(IdSession,EmailLu, emailUnread)
END
Remark: If the event "Add additional elements" returns False:
  • the internal wait window is not displayed anymore,
  • the "Adding additional elements" event is not run anymore.
WEBDEV - Server code The operation is identical.

Customization of the window or Page of patience

The gauge displayed during loading is contained in an internal window or an internal Page.
WINDEVWINDEV Mobile 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.
WEBDEV - Server code By Default , a standard internal Page is used, but it can be integrated into the project for customization. The progress bar is automatically managed.
Minimum version required
  • Version 21
This page is also available for…
Comments
Click [Add] to post a comment