PC SOFT

ONLINE HELP
FOR WINDEV, WEBDEV AND WINDEV MOBILE

Home | Sign in | English US
  • Overview
  • Attributes and controls of a browsing Looper control
  • Attributes and controls of a browsing Looper control in WEBDEV
  • Attributes and controls of a browsing Looper control in WINDEV or WINDEV Mobile
WINDEV
WindowsLinuxUniversal Windows 10 AppJavaReports and QueriesUser code (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Browser code
WINDEV Mobile
AndroidAndroid Widget iPhone/iPadApple WatchUniversal Windows 10 AppWindows Mobile
Others
Stored procedures
Overview
A browsing Looper control is a Looper control based on a data file or on a 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.
Versions 17 and later
The Live Data (available in the editor) is used to easily resize the controls found in the rows.
New in version 17
The Live Data (available in the editor) is used to easily resize the controls found in the rows.
The Live Data (available in the editor) is used to easily resize the controls found in the rows.
Attributes and controls of a browsing Looper control
WEBDEV - Server codeWEBDEV - Browser codePHP

Attributes and controls of a browsing Looper control in WEBDEV

A Looper control includes:
  • controls, that are repeated on each row.
  • attributes. An attribute is used to define the control characteristic that will be modified on each row. For example, if the value and the color of the PRICE control must change on each row, you will have to define two different attributes for the same control.
When creating a browsing Looper control, a control and an attribute are automatically created for each item found in the data file or in the query.
This attribute corresponds to the association between the control linked to the item of the data source (file or query) and the change of control value on each row.
To modify one or more characteristics of these controls (color, status, width, height, ...), you must:
  • add new attributes ("New" or "Insert" button in the control description).
  • handle these attributes by programming in the "Displaying a row of the Looper control" process.
For example, the Looper control named "LOOP_MyLooper" is based on "Customer" file. This data file contains 10 items (name, address, phone number, ... of each customer). When creating the Looper control, 10 controls and 10 attributes will be automatically created:
  • Each control will be linked to an item of "Customer" file.
  • Each attribute will indicate the characteristic that must be modified on each row: the value of the control.
In order for the background color of the "EDT_CustomerName" control to change on each row, you must:
  • add a new attribute ("ATT_ColorAttribute" for example). This attribute will be associated with the "EDT_CustomerName" control and it will have the "Background color" property.
  • handle this attribute by programming to define the requested background color. For example:
    // -- Displaying a row of LOOP_MyLooper
    Subscript is int
    // Retrieve the subscript of the current row
    Subscript = LOOP_MyLooper

    IF IsEven(Subscript) = True THEN
    // The background color will be red for the even rows
    ATT_ColorAttribute[Subscript] = LightRed
    ELSE
    // The background color will be blue for the the odd rows
    ATT_ColorAttribute[Subscript] = LightBlue
    END
Note: When creating a browsing Looper control, a pager is automatically associated with the Looper control. This pager is used to display the records found in the Looper control.
WINDEVAndroidiPhone/iPadWindows MobileUniversal Windows 10 AppJava

Attributes and controls of a browsing Looper control in WINDEV or WINDEV Mobile

A Looper control includes controls that are repeated on each row.
When creating a browsing Looper control, a control is created for each item found in the data file or in the query.
To modify one or more characteristics of these controls (color, status, width, height, ...), all you have to do is handle these controls by programming in the "Displaying a row of the Looper control" process.
For example, the Looper control named "LOOP_MyLooper" is based on "Customer" file. This data file contains 10 items (name, address and phone number of each customer for example). When creating the Looper control, 10 controls will be automatically created: each control will be linked to an item of "Customer" file.
In order for the background color of the "EDT_CustomerName" control to change on each row, this control must be handled by programming to define the requested background color. For example:
// -- Displaying a row of LOOP_MyLooper
Subscript is int
// Retrieve the subscript of the current row
Subscript = LOOP_MyLooper

IF IsEven(Subscript) = True THEN
// The background color will be red for the even rows
LOOP_MyLooper[Subscript].EDT_CustomerName..BrushColor = LightRed
ELSE
// The background color will be blue for the odd rows
LOOP_MyLooper[Subscript].EDT_CustomerName..BrushColor = LightBlue
END
Note: For compatibility with WEBDEV, you also have the ability to use the attributes.
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 Registered Cross-platform examples (WINDEV Mobile): WM Registered
[ + ] 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 required version
  • Version 9
This page is also available for…
Comments
Click [Add] to post a comment