ONLINE HELP
 WINDEVWEBDEV AND WINDEV MOBILE

This content has been translated automatically.  Click here  to view the French version.
Help / WLanguage / WLanguage functions / Controls, pages and windows / List Box functions
  • Multi-selection List Box control
  • Modified element
  • Modifying an element in the browser
  • Miscellaneous
WINDEV
WindowsLinuxJavaReports and QueriesUser code (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Browser code
WINDEV Mobile
AndroidAndroid Widget iPhone/iPadIOS WidgetApple WatchMac Catalyst
Others
Stored procedures
Modifies an element in a List Box, ListView or Combo Box control populated programmatically.
Note: The ListModify function can be used on both the List Box control and multiselection fields. .
WEBDEV - Browser code Attention: The element will be modified only on the page displayed in the browser. For more details, see Remarks.
Example
// Modification de l'élément situé à l'indice 4 dans le champ Liste "LISTE_ListeClient"
ListModify(LISTE_ListeClient, "Dupond", 4)
WINDEVReports and QueriesUser code (UMC)
// Modification de l'image située à l'indice 4 dans le champ Liste "LSI_Plongée"
ListModify(LSI_Plongée, "Belles gorgones", "C:\MesImages\Gorgones.JPG", 4)
Syntax
ListModify(<List Box control> , <Element> [, <Image> [, <Element index>]])
<List Box control>: Control name
Name of control to use:
  • List Box control,
  • Combo Box control.If this parameter corresponds to an empty string (""), the element is modified in the List Box control (or Combo Box) to which the current event belongs.
WEBDEV - Browser code The name of List Box or Combo Box control to use must necessarily be specified.
<Element>: Character string
Element to modify in the specified List Box (or Combo Box) control.
WINDEVJava For a ListView control, this parameter corresponds to the image caption.
WEBDEV - Server codeWEBDEV - Browser codePHP The Carriage Return characters (CR) and the tabulations (TAB) are not supported.
WEBDEV - Server code To add several consecutive spaces, use non-breaking spaces: Caract(160).
<Image>: Optional character string
Name and path of image that will be added into a ListView control. This parameter is taken into account for ListView controls displayed in ListView mode only.
If this parameter is not specified, the default image (defined in the "Detail" tab of the control description window) is used..
WEBDEV - Server codeWEBDEV - Browser codeAndroidiPhone/iPadPHP This parameter is not available.
<Element index>: Optional integer
Index of the element to be modified.
If this parameter:
  • is not specified or if it is set to -1, the current element is modified. ListModify has no effect if there is no current element.
  • is equal to 0, the first element is modified.
  • is greater than the number of items in the List Box control (or Combo Box control), a WLanguage error is generated.. The number of elements in a List Box (or Combo Box) control is returned by ListCount.
PHP ListModify has no effect if this parameter is equal to 0 or if it is greater than the number of elements found in the List Box (or Combo Box) control.
Remarks

Multi-selection List Box control

If one or more elements are selected in the List Box control, ListModify deselects no element.
WINDEVWEBDEV - Server codeReports and QueriesAndroidiPhone/iPadJavaUser code (UMC)Ajax

Modified element

When modifying an element containing an invisible value (specified by gStoredValue), gStoredValue must be re-used. Otherwise, this invisible value will be lost during the modification.
For example:
  • adding "MyElement":
    ListAdd(COMBO_MaCombo, "MonElément" + gStoredValue("1"))
  • modifying "MyElement":
    ListModify(COMBO_MaCombo, "MonNouvelElément" + gStoredValue("1"))
WEBDEV - Browser code

Modifying an element in the browser

When modifying an element in browser code, this element is modified only for the page displayed in the browser. To make changes to this element on the server as well, ListModify must be executed on the server.
Calling ListModify in browser code is useful when using AJAX technology, in "Programmed AJAX" mode (via AJAXExecute or AJAXExecuteAsynchronous).
Reminder: In "AJAX automatic and immediate" mode, simply switch the server processing containing the ListModify function to AJAX automatic mode. . That's it! No additional programming is required. For more details, see AJAX.

Miscellaneous

  • To modify an element in a Table control, use TableModify.
  • ListModify can be used on a "Combo Box" table column.
Component: wd300obj.dll
Minimum version required
  • Version 9
This page is also available for…
Comments
Exemplo ListModify
ListModify(LIST_List,"Modificando Segundo",2)

// Blog com Video e Exemplo
http://windevdesenvolvimento.blogspot.com.br/2016/11/aula-963-curso-windev-listbox-008.html
https://www.youtube.com/watch?v=09j73FXGrjE



De matos
04 Dec. 2016

Last update: 09/14/2024

Send a report | Local help