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
  • Moves and swipes
  • Fast scrolling
  • Moving rows
  • Action during a swipe
WINDEV
WindowsLinuxJavaReports and QueriesUser code (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Browser code
WINDEV Mobile
AndroidAndroid Widget iPhone/iPadIOS WidgetApple WatchMac Catalyst
Others
Stored procedures
Overview
In a mobile application, several options can be handled with the fingers, by performing specific movements.
For the Looper controls, WINDEV Mobile proposes several options used to manage these moves and gestures. These options can be configured in the "Details" tab of the Looper control description window.
Moves and swipes
Android

Fast scrolling

If "Fast scrolling" is selected, scrolling through the Looper control can be done more quickly thanks to a specific scrollbar track on the side of the control.
If "Alphabetical indexing on" corresponds to an attribute of a Looper control, an alphabet scrollbar will allow the user to quickly reach the lines whose attributes start with the chosen letter.
Warning: If this option is selected, the RepeatString Looper control must be sorted alphabetically on the specified attribute..
Use conditions:
  • Fast scrolling is only available for Looper controls populated programmatically or with in-memory data source.
  • Fast scrolling is not available for horizontal and multicolumn Looper controls.
Android

Moving rows

It is possible to allow the user to move the rows in a Looper control ("Move rows"). In this case, you have the ability to choose a move:
  • via a grip on the left,
  • via a grip on the right.
To perform a move by gesture, all you have to do is remain pressed on the element and move this element.
If the user is allowed to move rows, new events are associated with the Looper control:
Beginning of source Drag/DropThis event is 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.
Drop in target Drag/DropThis event is executed when the user finishes the element Drag/Drop. If this event returns False the movement is not performed.

Use conditions:
  • This feature is only available for Looper controls populated programmatically or with in-memory data source.
  • This feature is not available for horizontal and multicolumn Looper controls.

Action during a swipe

On the Looper controls, an action can be performed during a horizontal swipe of a row (drag the element from right to left or from left to right).
It is possible to:
  • an automatic deletion.
  • Android an action programmatically.
  • AndroidiPhone/iPad a customizable swipe.
Automatic deletion
If the "Automatic deletion" option is selected, new events are associated with the Looper control:
Before automatically deleting a row by swipeThis event is run before the automatic deletion of the 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.
After automatic deletion of a row by swipeThis event is run after the actual deletion of the record. This event is used, for example, to re-display the data.
Android Row swipe
This event is run BEFORE the "Before automatically deleting a row" event. If this event returns False, the "Before automatically deleting a row" event is not run and the record is not deleted.

Note: Only the record in the data file linked to the line in the RepeatString field is deleted.. The linked records found in the other data files are not automatically deleted.
Android Action through programming
If the "Action through programming" option is selected, a new event is associated with the Looper control:
Row swipeThis event is executed when the user swipes the row. This event allows you to program the desired action.
Note: You can find out the direction of the scan using the Gesture variable..

Use conditions:
  • Row swipe actions are only available for Looper controls populated programmatically or with in-memory data source.
  • Swipe actions are not available for horizontal and multicolumn Looper controls.
  • Swipe actions are available in the simulator.
AndroidiPhone/iPad Customizable swipe
This option is used to display a specific internal window during the swipe. This internal window proposes the actions to perform after the swipe. An example of internal window is supplied in standard but you also have the ability to use an internal window of project.
The parameters of the custom swipe are as follows:
  • Same actions for left and right sweep / Different actions depending on sweep orientation: These options define whether the sweep is managed in the same way regardless of its direction. You can use:
    • the same internal window for the swipe to the right and to the left.
    • a different internal window for the swipe to the right and to the left.
      Note: If an orientation is not associated with an internal window, scanning cannot be performed in that direction.
  • Internal window when scanning left and right: It is possible to use:
    • the default internal window. If this option is selected, you will be automatically prompted to import of the corresponding window (IW_Swipe) into the project..
    • a specific internal window. In this case, the global declaration code of the window must respect the following prototype:
      PROCEDURE <Nom de la fenêtre>(<Champ Zone répétée>, <Indice de la ligne balayée>)

      where:
      • <Looper control> represents the name of the Looper control on which the swipe is performed.
      • <Index of swiped row> represents the number of the swiped row.
  • Respect internal window width: Select whether the internal window retains its editing width (option checked) or whether the internal window width occupies the entire width of the RepeatString field (default option).
  • Run the swipe process:
    • Immediately: The Looper control's "Scan one line" event is executed when the internal window is displayed (when the internal window has covered the Looper control's line)..
    • The next time the RepeatString field is dequeued: the Looper control's "Single line sweep" event is executed the next time the RepeatString field is activated.. This option is recommended if the internal window contains buttons used to perform specific processes. Therefore, the "Row swipe" event will be run when the user handles the Looper control (the internal window will be closed).
If the "Customizable swipe" option is selected, a new event is associated with the Looper control:
Row swipeThis event is executed when the user swipes the row. The conditions for running this event depend on the "Run the swipe process" option in the customizable swipe settings.

Remarks:
  • The internal swipe window can be closed by LooperCancelSwipe. The Cancel button found in the internal window supplied in standard uses this function.
  • The internal window is loaded (execution of declaration and initialization codes) as soon as the swipe is started.
  • The internal window is unloaded (execution of closing code) when the internal window disappears.
  • iPhone/iPad SwipeEnabled is used to temporarily disable the swipe on a row found in the Looper control.
Related Examples:
WM ToDo List Cross-platform examples (WINDEV Mobile): WM ToDo List
[ + ] This example is a manager of To-Do Lists.
The project is using the gestures in the loopers in order to move and delete the lists and tasks.
The data is stored in a HFSQL database.
Minimum version required
  • Version 18
Comments
Click [Add] to post a comment

Last update: 09/21/2024

Send a report | Local help