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
  • Default events
  • Events supported by WINDEV and WINDEV Mobile
  • Events supported in WEBDEV
  • Filter records (Looper based on a data file only)
  • Click on a Looper control (browser code only)
  • Optional events
WINDEV
WindowsLinuxJavaReports and QueriesUser code (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Browser code
WINDEV Mobile
AndroidAndroid Widget iPhone/iPadIOS WidgetApple WatchMac Catalyst
Others
Stored procedures
Events associated with Looper controls
Default events
WINDEVAndroidiPhone/iPadJava

Events supported by WINDEV and WINDEV Mobile

The following events appear by default in the WINDEV and WINDEV Mobile code editor:
EventRuntime condition
InitializationExecuted when opening the window.*

Special case: control RepeatString automatically filled file:
When this code is run, the Looper control is not filled yet. To force the Looper control to be filled in this code, use:
You can also filter records with HFilter.
End of initializationEvent only for Looper controls populated automatically based on a data file:
Run once the Looper control has been filled. This code can be used to add or modify an element of the Looper control.
Entry in the Looper controlExecuted when one of the Looper controls gains focus.
Exit from the Looper controlExecuted when moving from one control to another (TAB key, selecting another control with the mouse, etc.).
Whenever a Looper control is modifiedExecuted when the user modifies the content of the Looper control.
Entry in edit in a row of the Looper controlExecuted when the user selects a row to enter data.
Exit a row of the Looper controlExecuted when moving from one row or control to another (TAB key, selecting another control with the mouse, etc.).
Display a row of the Looper controlExecuted when a new repetition is to be displayed in the RepeatString field: redisplay of the RepeatString field, etc.
iPhone/iPad This event is not available in Looper controls based on a data file for performance reasons.
Select a row of the Looper controlExecuted when the user selects a row (without input).
AndroidiPhone/iPad Pull to refresh
This event is automatically added when the "Pull to refresh" option is enabled ("Details" tab in the Looper control description window).
This event is executed when a refresh gesture is detected on the Looper control.
Once this event has been run, the refresh bar will be automatically hidden except if LooperRefreshVisible is called.
AndroidiPhone/iPad Before automatically deleting a row by swipe
Event only available if an automatic deletion on row swipe has been defined ("Details" tab of the control description)
Run before the automatic deletion of record displayed in the row. This event is used to run different tests for example. If this event returns False the deletion is not performed.
AndroidiPhone/iPad After automatic deletion of a row by swipe
Event only available if an automatic deletion on row swipe has been defined ("Details" tab of the control description)
Run after the effective deletion of the record. This event is used, for example, to re-display the data.
Android Row swipe
Event only available if an action on row swipe has been defined ("Details" tab of the control description)
  • Case of automatic deletion: This event is executed BEFORE the "Before deleting a line" event.. If this event returns False, the "Before automatically deleting a row" event is not run and the record is not deleted.
  • Programmed action: This event is executed when the user scans the line.. This event allows you to program the desired action.
Android Beginning of source Drag/Drop
Run at the beginning of Drag/Drop for the element. This event is used to run different tests for example. If this event returns False the movement is not performed.
Android Drop in target Drag/Drop
Executed when the user finishes the element Drag/Drop. If this event returns False the movement is not performed.
Filtering recordsOptional code for Looper controls populated automatically based on a data file:
Run just before displaying a row. This event filters the records displayed in the Looper control. This event is detailed at the end of this page.
Android This event is not available.
Scrolling events (optional events)These events make it easy to manage the vertical scrollbar in the control. The available events are:
  • Scroll start: Executed when the field's vertical scrollbar starts to scroll..
  • During scrolling: Executed when scrolling the field's vertical scrollbar..
  • Scroll end: Executed at the end of the field's vertical scrollbar..
Note: The ScrollbarPosition function is used to find out the position of the elevator..

(*) By default, the "Initialization" event of each control is executed according to the order in which the controls were created in the window. To modify this runtime order:
  1. On the "Window" tab, in the "Order" group, click "Initialization".
  2. In the window that appears, use the arrows on the right to change the order in which the controls are initialized.
WEBDEV - Server codePHP

Events supported in WEBDEV

The following events appear by default in the WEBDEV code editor:
EventRuntime condition
Initialization (Server code)Executed when the page is opened.
Special case: RepeatString zone automatically fills file:
When this code is run, the Looper control is not filled yet. To force the Looper control to be filled in this code, use:
End of initialization (Server code)Code only for Looper controls populated automatically based on a data file:
Run once the Looper control has been filled. This code can be used to add or modify an element of the Looper control.
Row display (Server code)Executed when a new row is to be displayed in the RepeatString field: redisplay of the RepeatString field, ...
Used to manage calculated attributes.
Filter records (Server code)Code only for Looper controls populated automatically based on a data file:
Run just before displaying a row. This event filters the records displayed in the Looper control. This event is detailed at the end of this page.

Note: In a static page, only optional events are available.
Filter records (Looper based on a data file only)
WINDEVWEBDEV - Server codeiPhone/iPadPHP The event "Filtering the records" is run right after a row of the Looper control is displayed. Therefore, it is run:
  • when initializing the Looper control.
  • whenever a row is displayed in the Looper control.
This event filters the records displayed in the Looper control.
To implement a filter, the "Filter records" event must return a value:
  • True to specify that the record matches to the filter and that it must be displayed.
  • False to specify that the record does not match the filter and that it must not be displayed.
  • Cancel to stop reading the data source of the Looper control (very rare case).
Example:
// -- Filtrage des enregistrements --
// Affiche uniquement les clients dont commandes sont supérieures à 3000 euros
IF Commande.TotalTTC >= 3000 THEN 
	RETURN True
ELSE
	RETURN False
END
In this code, the data handled affects the record currently read by the Looper control. This data comes from the data file or query linked to the Looper control.
Note: In WINDEV and WINDEV Mobile, the "Record filtering" event is optional.. In WEBDEV, this event is proposed by default.
Click on a Looper control (browser code only)
The "Click on the Looper control" event is executed when the user clicks on a row of the Looper control. This process is used to select the row. This event returns the values of the attributes corresponding to the row. For example, the following click code is used to find out the value of the ATT_Title attribute for the row that was clicked:
Trace(ATT_Titre)
Optional events
Several optional events can be added. To add an optional event:
  1. Select the desired control.
  2. Display the code window of this control (F2 key).
  3. Click the link "Add other events to xxx" at the bottom of the window code, after the last event.
  4. All the optional events available for the control are displayed.
  5. Check the optional event to add and validate.
    Note: Several optional events can be selected.
  6. The selected optional event is automatically added to the events managed by the control.
To disable an optional event, simply perform the same operations to display the list of optional events. Then simply uncheck the optional events to delete.
Note: If the deactivated code contains WLanguage code, this code is automatically deleted..
For example, you can use the following events:
  • left mouse button down, up, double click,
  • right button down, up, etc.
For more details, see the Optional events.
Minimum version required
  • Version 9
This page is also available for…
Comments
Click [Add] to post a comment

Last update: 09/18/2024

Send a report | Local help