AYUDA EN LÍNEA
 WINDEVWEBDEV Y WINDEV MOBILE

Este contenido se ha traducido automáticamente.  Haga clic aquí  para ver la versión en inglés.
Ayuda / Desarrollar una aplicación o un sitio web / Controles, ventanas y páginas / Controles: tipos disponibles / Control Looper
  • 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 WEBDEV
WINDEV
WindowsLinuxJavaReportes y ConsultasCódigo de Usuario (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Código Navegador
WINDEV Mobile
AndroidWidget Android iPhone/iPadIOS WidgetApple WatchMac Catalyst
Otros
Procedimientos almacenados
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
WEBDEV - Código ServidorWEBDEV - Código NavegadorPHP

Attributes and controls of a Looper control based on a data file in WEBDEV

A Looper control includes:
  • controls, that are repeated on each row.
  • attributes. An attribute defines the control characteristic that will change on each row. For example, if the value and color of the PRICE control must change on each row, you need to define two different attributes for the same control.
For new Looper controls based on a data file, a control and an attribute are automatically created for each item from the data file or query.
This attribute corresponds to the association between the control linked to the item of the data source (data 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 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 fields (name, address, telephone number, etc. for 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 data file "Customer".
  • Each attribute will indicate the characteristic to be modified at each row: the field value.
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 through programming to define 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
    ATT_ColorAttribute[Index] = LightRed
    ELSE
    // The background color will be blue for the odd rows
    ATT_ColorAttribute[Index] = LightBlue
    END
Remark: When creating a file RepeatString field, an slider is automatically associated with the RepeatString field.. This pager is used to display the records from the Looper control.
Versión mínima requerida
  • Versión 9
Esta página también está disponible para…
Comentarios
Haga clic en [Agregar] para publicar un comentario

Última modificación: 05/12/2024

Señalar un error o enviar una sugerencia | Ayuda local