PC SOFT

ONLINE HELP
 WINDEVWEBDEV AND WINDEV MOBILE

Home | Sign in | English EN
This content has been translated automatically. Click here to view the French version.
  • Belonging of controls
  • Using retrieved controls
  • WLanguage error
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
Returns the name of Nth control found in the specified element. This element must be displayed.
Remark: In most cases, we recommend that you use gpwEnumControl that lists all controls directly.
WEBDEV - Server code The specified element can be a page, a report, a group of controls, a Looper control, a break in a Looper control, a Cell control or a supercontrol
In a loop, this function is used to enumerate the controls found in an element.
WEBDEV - Server codeAjax
// Nom du champ 7 de la page "PAGE_MaPage"
ResChamp = EnumControl(PAGE_MaPage, 7)
WEBDEV - Server codeAjax
// Remplir un champ Combo avec la liste des champs de la page
i is int = 1
ResChamp is string
ResChamp = EnumControl(PAGE_MaPage, i)
WHILE ResChamp <> ""
i++
ListAdd(COMBO_ListeChamp, ResChamp)
ResChamp = EnumControl(PAGE_MaPage, i)
END
Syntax
<Result> = EnumControl(<"Parent" object> , <Control number>)
<Result>: Character string
  • Name of control found,
  • Empty string ("") if no control was found.
<"Parent" object>: Character string
Name of "parent" object (containing the control). This parameter corresponds to the name of a window, a Looper control, a break in a Looper control, a group, a Tab control, a supercontrol o a report.
If the "parent" object is a Tab control, the following syntax must be used: <Name of Tab control>[<Number of tab pane>]. For example: TAB_Tab1[2].
WEBDEV - Server code Name of "parent" object (containing the control). This parameter corresponds to the name of a page, a report, a group of controls, a Looper control, a break in a Looper control, a Cell control or a supercontrol.
<Control number>: Integer
Number of the control whose name is requested. Each control is associated with a number. This number corresponds to:
  • the creation order of the controls (by default) if the type of enumeration is performed by the byCreationOrder constant
  • the tab order (which means the order in which the controls take focus in the "parent" object) if the type of enumeration is performed with the byTabOrder constant.
    The F5 key is used to see the navigation order in the window editor and in the page editor
Remarks

Belonging of controls

Only the controls that directly belong to the specified "parent" object are enumerated.
For example, if <"Parent" object> corresponds to the name of a window (or page), EnumControl only works for the controls that directly belong to this window (or to this page). EnumControl cannot be used to retrieve the names of the controls belonging to the Tab controls or the supercontrols of this window (or page).

Using retrieved controls

When the name of a control retrieved by EnumControl is contained in a variable, the control itself can be used thanks to indirection operators (braces { and }). Example:
// Nom du champ 7 de la page
NomChamp is string = EnumControl(MyPage, 7)
// Libellé du champ
ToastDisplay({NomChamp}..Caption)
WEBDEV - Server code To use an indirection on a control of a page, the option "Allow indirections (slows the execution down)" must be checked ("Details" tab in the control description window).

WLanguage error

A WLanguage error occurs if:
  • <Control number> is negative.
  • <Control number> is greater than the number of controls found in <"Parent" object> +1. This is used to avoid the endless loops.
  • <"Parent" object> is not a window, a page, a report, a group, a Tab control or a supercontrol.
Component: wd260vm.dll
Minimum version required
  • Version 9
This page is also available for…
Comments
USE
gpwEnumControl (Function)

Mesmo não tendo o uso do gwplogin ou a instalação do groupware esse comando é independente e funciona melhor.
BOLLER
14 May 2019