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 / WLanguage / Funciones WLanguage / Controles, páginas y ventanas / Funciones List Box
  • Type of search
  • parameter
  • Uppercase/Lowercase characters
  • Seeking and selecting an element in a List Box or Combo Box control
  • Search in a List Box control or Combo Box control linked to data: search on the stored value or on the displayed value
  • Search and selection in a List Box control linked to data
  • Miscellaneous
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
Seeks an element in a List Box control (standard list box or listview) or in a Combo Box control (including the values described by gStoredValue).
WEBDEV - Código Navegador In this version, the values described by gStoredValue cannot be sought.
Note: The <List Box>.Seek function can be used on both:
  • Data-linked List Box control or Programmed List Box control,
  • single-selection or multi-selection List Box controls.
PHP Reminder: In this version, the List Box control fields are not available.
Ejemplo
// Find the element "Moore" in the List Box control "LIST_CustomerList"
ResSeek = LIST_CustomerList.Seek("Moore")
WINDEVWEBDEV - Código ServidorWEBDEV - Código NavegadorReportes y ConsultasAndroidJavaCódigo de Usuario (UMC)Ajax
// Search for "Dubois" in List Box control linked to "LISTE_ListeClient" data
// Exact-match search from element 5
ResSeek = LIST_CustomerList.Seek("Moore", True, 5)
Sintaxis
<Result> = <List Box control>.Seek(<Search element> [, <Type of search> [, <Start of search>]])
<Result>: Integro
  • Index of the element found.
  • -1 if no element corresponds to the search.
The element found is not selected. To select the element found, use <List Box>.SelectPlus.
WINDEV In a List Box control linked to data, the item found is displayed if it is not visible.
<List Box control>: Nombre del control
Name of List Box (or Combo Box) control to use.
<Search element>: Cadena de caracteres
Element to find in the specified List Box (or Combo Box) control.
<Type of search>: Booleano opcional
  • True (default value) for an exact-match search,
  • False for a generic search.
PHP This parameter is not available. An exact-match search is performed by default.
<Start of search>: Entero opcional
Index from which the search will start in the List Box or Combo Box control.
If this parameter is not specified, the search is performed in the entire control. This parameter is ignored for controls manipulated programmatically.
PHP This parameter is not available. The search is performed in the entire control by default.
Observaciones

Type of search

  • Exact-match search:
    The elements whose value is strictly equal to <Search element> are returned by <List Box>.Seek. For example:
    // Return all the customers named "Doe" found in "LIST_Name"
    LIST_Name.Seek("Doe")
  • Generic search:
    The elements starting with <Search element> are returned by <List Box>.Seek. For example:
    // Return all customers whose name starts with "SMI"
    LIST_Name.Seek("SMI", False)

<Start of search> parameter

The <Start of search> parameter is used to find all the occurrences of a string in a List Box or Combo Box control.
For example, to count the number of names starting with "SMI" in the "LIST_CustomerList" control:
Index is int
Cnt is int = 0
// Position on the first corresponding element
Index = LISTE_ListeClient.Seek("DUP", False)
WHILE Index <> -1
	Cnt++
	// Find the next name starting with "SMI"
	Index = LISTE_ListeClient.Seek("DUP", False, Index + 1)
END
WINDEVWEBDEV - Código ServidorReportes y ConsultasAndroidiPhone/iPadJavaCódigo de Usuario (UMC)PHPAjax

Uppercase/Lowercase characters

  • If the control is a List Box control populated programmatically, the search ignores the uppercase and lowercase characters.
  • If the field is a List Box control linked to data, the search on "Key" type fields takes into account the search options defined in the data model editor ("General" tab of the field description).
PHP The search is case sensitive.
PHP List Box controls based on a data file are not available.
WINDEVWEBDEV - Código ServidorReportes y ConsultasAndroidiPhone/iPadCódigo de Usuario (UMC)Ajax

Seeking and selecting an element in a List Box or Combo Box control

To search and/or select an item present in a List Box control (or Combo Box control) linked to data, you can also use the following syntax:
LIST_OrderList.StoredItem = "CustomerID"
// Find and select the element whose CustomerID is "135"
LIST_OrderList = 135
// If the element sought is not found, LIST_OrderList will be set to -1
AndroidJava The sought element is selected.
WINDEVWEBDEV - Código ServidorReportes y ConsultasiPhone/iPadCódigo de Usuario (UMC)Ajax

Search in a List Box control or Combo Box control linked to data: search on the stored value or on the displayed value

Case 1: The List or Combo Box control is fed by a data file ("Direct access" option):
The search is performed according to the value of gStoredValueEnable:
  • If gStoredValueEnable(Field, True) (default): The function <List Box>.Seek FUNCTION searches on the "browse item" declared in the "Contents" tab of the field description.
  • If gStoredValueEnable(Field, False): The function <List Box>.Seek FUNCTION searches on the "displayed item" declared in the "Content" tab of the field description.
Case 2: The List or Combo Box control is fed by a data file ("Loaded into memory" option):
<List Box>.Seek performs the search on the "displayed item" declared in the "Content" tab of control description.
WINDEVWEBDEV - Código ServidorReportes y ConsultasAndroidiPhone/iPadJavaCódigo de Usuario (UMC)Ajax

Search and selection in a List Box control linked to data

If the options used to populate the List Box control are defined in the description window of the control ("Content" tab), the following syntax can be used to seek and select an element in a List Box control:
ListBoxName = SoughtElement
The options used to populate the List Box control are:
  • Data file,
  • Displayed item,
  • Search item.
Description of data-related List Box control
WINDEVWEBDEV - Código ServidorWEBDEV - Código NavegadorReportes y ConsultasJavaCódigo de Usuario (UMC)Ajax

Miscellaneous

  • To search a Table control or Combo Box control, use the TableSearch function.
  • <List Box>.Seek can be used on a "Combo Box" table column.
Componente: wd300obj.dll
Versión mínima requerida
  • Versión 23
Esta página también está disponible para…
Comentarios
Haga clic en [Agregar] para publicar un comentario

Última modificación: 08/01/2025

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