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
  • Add break
  • Add break
  • Top and break footer
  • Image of break buttons
  • Manipulating the controls found in the break headers and footers
  • Initializing the controls found in the break headers and footers
  • Retrieving the value of controls found in the break headers and footers
  • Automatic calculations in the breaks of Looper controls
  • Handling the break headers and footers programmatically
  • Initializing the break headers and footers
  • Functions associated with break headers and footers
  • Properties associated with the break headers and footers
  • Managing breaks in the Looper controls programmatically
WINDEV
WindowsLinuxJavaReports and QueriesUser code (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Browser code
WINDEV Mobile
AndroidAndroid Widget iPhone/iPadIOS WidgetApple WatchMac Catalyst
Others
Stored procedures
Overview
A break in a Looper control is used to group the data corresponding to one or more arguments.
For example, you can list:
  • the customers by country and by city,
  • the invoices per customer,
  • the products according to their family and sub-family, ...
The breaks in Looper controls are available for:
  • Looper controls with in-memory data source.
  • Memory Looper controls.
  • WEBDEV - Server codeWEBDEV - Browser code Looper controls in Standard, AJAX and Browser mode.
WINDEV Remarks:
Android Breaks in Looper controls are not available in Multicolumn Looper controls.
Add break

Add break

To add a break into a Looper control:
  1. Display the RepeatString Looper control description window ("Description" option in the context menu).
  2. On the "Content" tab, click Break button. The window for managing breaks is displayed:
    Defining the breaks
  3. Select the item or the attribute on which a break must be performed. Several items and/or attributes can be selected in order to implement several breaks.
    The suggested items and attributes depend on the type of Looper control:
    • In a Looper control linked to a data file:
      • automatic browse: the browse item, the attributes linked to this browse item and the attributes linked to no browse item are proposed.. If the search item corresponds to a composite key, the components of this composite key, the attributes linked to these components and the attributes linked to no item are proposed.
      • programmed route: data file items, attributes linked to these items and attributes linked to no item are proposed.
    • In a Looper control linked to a query:
      • automatic browse: the browse item, the attributes linked to this browse item and the attributes linked to no browse item are proposed.. If the search item is not specified ("<Automatic>" option), the sorted query items, the attributes linked to these items and the attributes linked to no item are proposed.
      • programmed path: query items, attributes linked to these items and attributes linked to no item are proposed.
    • In a memory looper, all looper attributes are proposed.
  4. Validate the window for break management.
  5. The breaks will be performed according to the order in which they are displayed in the table of breaks found in the "Content" tab of the looper description. Modify (if necessary) this order via the arrow buttons found on the right of table.
  6. Specifies the operating mode of breaks:
    • WINDEVWindowsLinuxAndroidiPhone/iPad whether breaks must be "Breaks with collapsed/expanded". If this option is checked, a "+ /-" button is automatically added into the break header. This button will allow the user to collapse or expand the break.
    • WEBDEV - Server codePHP whether breaks must be "Collapsable/Expandable breaks via a simple click in the background". If this option is checked, the user will have the ability to click in the break header to collapse or expand the break according to his own requirements.
  7. Validate.
Remarks:
  • Breaks can be created in the single-column loopers and in the multicolumn loopers.
  • WINDEVAndroidiPhone/iPad A break header can be always visible. In this case, during the scroll, the bar of the break will not be moved. In order for a break header to be always visible:
    • Select the break header and display its description ("Description" in the context menu).
    • On the "UI" tab, check "Break header always visible".

Top and break footer

When adding a new break, a break header and a break footer are automatically added to the looper. If the looper includes several breaks, there will be as many break headers and break footers as the number of breaks.
The characteristics of these break headers and footers (name, visibility, background color, ...) can be modified in their description window ("Description" in the context menu).
Each break header and break footer is associated with the "Display a row" event. This event is executed when a new break header or break footer is displayed in the Looper control.
These break headers and footers can contain controls. These controls can be handled programmatically.
WINDEVWindowsLinux The sums, averages and counts are automatic in the looper breaks. The controls found in the break headers and footers can display these calculations. For more details, see automatic calculations in the looper breaks.
WINDEVWindowsLinuxAndroidiPhone/iPad

Image of break buttons

To modify the image of break buttons:
  1. Display the RepeatString Looper control description window ("Description" option in the context menu).
  2. A break is defined in the "Content" tab.
  3. On the "Style" tab, select the "Break, border in creation" element.
  4. Click the "Plus/Minus image of breaks" button.
  5. In the area that is displayed, enter the path of the image for the break button. This image is an image with 2 states (plus and minus) in 24 x 12 format.
    Customizing the break buttons
Manipulating the controls found in the break headers and footers

Initializing the controls found in the break headers and footers

To initialize the controls found in the break headers and footers:
  • handle each control found in all the break headers and footers:
    <Nom Champ>.<Nom Propriété> = <Valeur>
    ou
    <Nom Zone répétée>.<Nom Haut/Bas de rupture>.<Nom Champ>.<Nom Propriété> = <Valeur>
    If <Property name> corresponds to Value, only the value of the control specified for the current row is modified
  • handle each control found in a given break:
    <Nom Zone répétée>[<Indice>].<Nom Champ>.<Nom Propriété> = <Valeur>
    <Index> must correspond to one of the rows in the specified break.
  • handle each attribute found in all the break headers and footers:
    <Nom Attribut> = <Valeur>
    The property associated with <Attribute name> will be initialized.
  • handle each attribute of a given break:
    <Nom Attribut>[<Indice>] = <Valeur>
    The property associated with <Attribute name> will be initialized.
    <Index> must correspond to one of the rows in the specified break.
Remark: These lines of code must be present in the "Display top / break footer line" event.

Retrieving the value of controls found in the break headers and footers

To retrieve the value of controls found in the break headers and footers:
  • handle each control found in the current break:
    <Valeur> = <Nom Champ>.<Nom Propriété>
    ou
    <Valeur> = <Nom Zone répétée>.<Nom Haut/Bas de rupture>.<Nom Champ>.<Nom Propriété>
  • handle each control found in a given break:
    <Valeur> = <Nom Zone répétée>[<Indice>].<Nom Champ>.<Nom Propriété>
    <Index> must correspond to one of the rows in the specified break.
  • handle each attribute found in all the break headers and footers:
    <Valeur> = <Nom Attribut>
    The value of the property associated with <Attribute name> will be retrieved.
  • handle each attribute of a given break:
    <Valeur> = <Nom Attribut>[<Indice>]
    The value of the property associated with <Attribute name> will be retrieved.
    <Index> must correspond to one of the rows in the specified break.
Remark: These lines of code must be present in the "Display top / break footer line" event.
WINDEV
Automatic calculations in the breaks of Looper controls
You have the ability to perform automatic calculations (sum, count and average) in the break headers and footers.
To implement the automatic calculations:
  1. Insert a Static Text control or an edit control into the break header and footer.
  2. Open the control description window (select "Description" in the context menu).
  3. On the "UI" tab, in the "In a break, display" area, click the "No calculation" link or click the calculation description (if an automatic calculation was already defined). The description window of an automatic calculation is displayed.
  4. Select the calculation to perform. You can choose to:
    • "The sum of": the field will display the sum per break.
    • "The average of": the field will display the average over the break.
    • "The number (count) of": the field will count the number of elements per break.
  5. Select the element on which the calculation must be performed. The calculation can be performed on:
    • A field: the calculation will be performed on the field's value property.
    • An attribute of the RepeatString zone: the calculation will be performed using the attribute's property.
    • A data file heading (only for RepeatString fields).
  6. Validate.
Tips:
  • Don't forget to modify the input mask of the control that displays the calculation according to the type of calculated information.
  • Don't hesitate to use the "eye magnet" technology on the edit controls that display calculations in the breaks. This gives you the ability you to highlight a calculation (displaying an insufficient turnover in red for example).
Handling the break headers and footers programmatically

Initializing the break headers and footers

To initialize the break headers and footers, use the following syntax:
<Nom Haut/Bas de rupture>.<Nom Propriété> = <Valeur>
Remark: These lines of code must be present in the "Display top/bottom break footer line" event.

Functions associated with break headers and footers

The following functions are associated with the break headers and footers:
LooperBreakIndexReturns the index of the break header and footer for a given break in a Looper control.
LooperCollapseCollapses a break that was expanded beforehand in a Looper control.
LooperCollapseAllCollapses all expanded breaks in a Looper control.
LooperCollapseExpandOn a given row of a Looper control:
  • collapses a break (if it is expanded),
  • expands a break (if it is collapsed).
LooperExpandExpands a break in the Looper control on a given row.
LooperExpandAllExpands all breaks in a Looper control with break.

Properties associated with the break headers and footers

Several properties are used to handle the breaks through programming, especially:
CollapsedThe Collapsed property is used to:
  • get or define the state (collapsed or expanded) that will be used when rows are added to a TreeView Table control.
  • know or modify the wound/unwound status for:
    • the breaks of a Table control,
    • the breaks of a Looper control,
    • the break headers and footers of Table and Looper controls,
    • a Drawer control,
    • a Ribbon control,
    • a Navigation Bar control.
    • a Pivot Table control in a report.
For a complete list of available properties, see Properties available for the breaks (Looper).
WINDEV
Managing breaks in the Looper controls programmatically
The following functions are used to create and manipulate breaks in the Looper controls:
BreakAddAdds a break into a Table or Looper control.
BreakDeleteDeletes a break from a Table control or from a Looper control.
BreakDeleteAllDeletes all breaks from a Table control or from a Looper control.
To add a break in a Looper control, use BreakAdd. The new break corresponds to a variable of type Control that can be handled with the same WLanguage properties as a break created in the editor.
Minimum version required
  • Version 10
This page is also available for…
Comments
Click [Add] to post a comment

Last update: 01/22/2025

Send a report | Local help