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
  • Attributes and controls of a Looper control based on a data file
  • Attributes and controls of a Looper control based on a data file in WINDEV or WINDEV Mobile
WINDEV
WindowsLinuxJavaReports and QueriesUser code (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Browser code
WINDEV Mobile
AndroidAndroid Widget iPhone/iPadIOS WidgetApple WatchMac Catalyst
Others
Stored procedures
Overview
This type of Looper control uses data from a data file or query.
Each row found in the Looper control corresponds to a record of the data source.
The number of records that can be viewed is unlimited, only the visible rows of control are loaded in memory.
The Live Data (available in the editor) is used to easily resize the controls found in the rows.
Attributes and controls of a Looper control based on a data file
AndroidiPhone/iPad

Attributes and controls of a Looper control based on a data file in WINDEV or WINDEV Mobile

A Looper control includes controls that are repeated on each row.
For new Looper controls based on a data file, a control is created for each item from the data file or query.
To modify one or more characteristics of these controls (color, state, width, height,...), simply handle them through programming in the "Display a row" event of the Looper control.
For example, the Looper control "LOOP_MyLooper" is based on the data file "Customer". This data file contains 10 items (name, address and phone number of each customer for example). When creating the RepeatString Looper control, 10 fields are automatically created: each field is linked to an item in the "Customer" data file.
To get a different background color for "EDT_CustomerName" on each row, simply handle this control through programming to set the desired background color. For example:
// -- Displaying a row of LOOP_MyLooper
Index is int
// Retrieve the index of the current row
Index = LOOP_MyLooper

IF IsEven(Index) = True THEN
	// The background color will be red for the even rows
	LOOP_MyLooper[Index].EDT_CustomerName.BackgroundColor = LightRed
ELSE
	// The background color will be blue for the odd rows
	LOOP_MyLooper[Index].EDT_CustomerName.BackgroundColor = LightBlue
END
Note: For WEBDEV compatibility, attributes can also be used.
Related Examples:
webmillion Complete examples (WEBDEV): webmillion
[ + ] The following topics are presented in this example:
1/ Using queries
2/ Using "browsing" loopers in automatic browse
3/ Using "browsing" loopers in manual browse

Summary of the example supplied with WEBDEV:
This Web application, powered by WEBDEV, is used to display, find and order tee-shirts.
Once the order is placed, you have the ability to use the PayBox module for secure payment.

This example contains a page used to generate a data file containing an important number of records.
WM Attendance Cross-platform examples (WINDEV Mobile): WM Attendance
[ + ] This application is an attendance manager. It allows you to list the persons who attended a meeting.
The database is filled beforehand with the list of registered persons.
You have the ability to find a person by using his/her name.
The following topics are presented in this example:
1/ using a browsing looper based on a query
2/ using a database in HFSQL format.
WM Managing Contacts Cross-platform examples (WINDEV Mobile): WM Managing Contacts
[ + ] This example presents the management of contacts for Android et iOS.
It is used o:
- list the contacts found on the phone
- call the contacts
- send SMSs to the contacts
- ...
Minimum version required
  • Version 9
This page is also available for…
Comments
Click [Add] to post a comment

Last update: 12/05/2024

Send a report | Local help