ONLINE HELP
 WINDEVWEBDEV AND WINDEV MOBILE

Help / WLanguage / WLanguage functions / Controls, pages and windows / List Box functions
  • Cascading deletions
  • Deleting an element on 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
Deletes an element from a List Box, ListView or Combo Box control populated programmatically.
Note: The <List Box>.Delete function can be used for both List Box control and multiselection fields. .
WEBDEV - Browser code Caution: The item will be deleted only on the page displayed in the browser. For more details, see Remarks.
Example
// Suppression de l'élément sélectionné dans le champ "LISTE_ListeClient"
LISTE_ListeClient.Supprime()
Syntax
<List Box control>.Delete([<Element index>])
<List Box control>: Control name
Name of List Box (or Combo Box) control to use.
<Element index>: Optional integer
Index of the element to delete from the List Box or Combo Box control. If this parameter is not specified:
  • in a single-selection List Box control, the current element is deleted.
  • in a multi-selection List Box control, the selected elements are deleted.
  • in a Combo Box control, the current element is deleted. If this control is an editable Combo Box control, the edit control is cleared.
WEBDEV - Server codeWEBDEV - Browser code The editable Combo Box controls are not available.
Remarks

Cascading deletions

When deleting a set of elements, the elements found after each deleted element are moved. To perform cascading deletions, we advise you to start from the last element.
For example:
Indice is int
FOR Indice = LISTE_ListeClient.Occurrence() TO 1 STEP -1
	LISTE_ListeClient.Supprime(Indice)
END
WEBDEV - Browser code

Deleting an element on the browser

When deleting an element in browser code, this element is only deleted from the page displayed in the browser. In order for this element to be deleted from the server, <List Box>.Delete must be run on the server.
Calling <List Box>.Delete 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 <List Box>.Delete function to AJAX automatic mode. . That's it! No additional programming is required. For more details, see AJAX.

Miscellaneous

  • To delete an element from a Table control, use <Table>.Delete.
  • <List Box>.Delete can be used on a "Combo Box" table column.
Component: wd300obj.dll
Minimum version required
  • Version 23
This page is also available for…
Comments
Click [Add] to post a comment

Last update: 09/26/2024

Send a report | Local help