- Multi-selection List Box control
- Modified element
- Modifying an element in the browser
In french: ListeModifie
Modifies an element in a List Box, ListView or Combo Box control populated programmatically.
can be used on the single-selection and multi-selection List Box controls.
: The element will be modified on the page displayed in the browser only. For more details, see Remarks.
// Modify the element found at subscript 4 in "LIST_CustomerList"
ListModify(LIST_CustomerList, "Moore", 4)
ListModify(<List Box control> , <Element> [, <Image> [, <Element index>]])
<List Box control>: Control name
Name of the control to be used:
- 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.
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.
For a ListView control,
this parameter corresponds to the image caption.
To add several consecutive spaces, non-breakable space characters must be used: Charact(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 "Details" tab in the description window of control) will be used.
<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 elements found in the List Box (or Combo Box) control, a WLanguage error occurs. The number of elements in a List Box (or Combo Box) control is returned by ListCount.
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.
Multi-selection List Box control
If one or more elements are selected in the List Box control, ListModify deselects no element.
When modifying an element containing an invisible value (specified by gStoredValue
must be re-used. Otherwise, this invisible value will be lost during the modification.
- adding "MyElement":
ListAdd(COMBO_MyCombo, "MyElement" + gStoredValue("1"))
- modifying "MyElement":
ListModify(COMBO_MyCombo, "MyNewElement" + gStoredValue("1"))
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.
: In "Automatic and immediate AJAX" mode, all you have to do is switch the server process containing ListModify
to automatic AJAX mode. That's it! No additional programming is required. For more details, see AJAX
- To modify an element in a Table control, use TableModify.
- ListModify can be used on a "Combo Box" table column.
This page is also available for…
// Blog com Video e Exemplo