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 / Table functions
  • Use conditions
  • Row characteristics
  • Table field/Hierarchical file table: Changes to the linked data file
  • Changes in a Table or TreeView Table control based on a data file
  • Modifying a record in a Table control based on a data file and releasing a Trigger
  • TableModify function and Modified property
WINDEV
WindowsLinuxJavaReports and QueriesUser code (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Browser code
WINDEV Mobile
AndroidAndroid Widget iPhone/iPadIOS WidgetApple WatchMac Catalyst
Others
Stored procedures
Modifies a row in:
  • a Table control,
  • a TreeView Table control,
  • WINDEV a table displayed in a Combo Box control.
Note: We recommend using the TableModifyLine function.. TableModifyLine is used to add:
  • TAB characters into the columns,
  • all types of values into the columns.
Example
// Modification des éléments "Paul" et "Dubois" de la cinquième
// ligne du champ "TABLE_TableClient"
TableModify(TABLE_TableClient, "Paul" + TAB + "Dubois", 5)
// Modification dans une colonne d'un champ Table
TableModify(COL_NOM, "Dubois", 5)
Syntax
TableModify(<Table control> , <Row> [, <Index>])
<Table control>: Control name
Name of the control to be used. This control can correspond to:
  • a Table control.
  • a TreeView Table control.
  • WINDEV a Combo Box control with table.
If this parameter corresponds to an empty string (""), the control used will be the control to which the current event belongs.
<Row>: Character string
Modified row replacing the specified row. This row has the following format:
<Elément de la colonne 1> + TAB + <Elément de la colonne 2> + TAB + ...
<Index>: Optional integer
Index of the row to be modified. The value of first row is set to 1.
Index not specified or equal to -1The current row is modified. This constant has no effect if no row is selected.
Index greater than the number of control rowsA WLanguage error occurs.
Remarks

Use conditions

TableModify can be used on:
  • Table or TreeView Table controls based on a data file.
  • Table or TreeView Table controls populated programmatically.
  • single-selection or multi-selection controls.
    WEBDEV - Server codePHP Reminder: Multiselection is not available for classic Table fields.
WEBDEV - Server codePHP This function is available for Table controls in "Server" and "Server + AJAX" mode, and for TreeView Table controls.
WEBDEV - Browser code This function is available for Table controls in "Browser" mode only.
WEBDEV - Browser code The TreeView Table control is not available.
AndroidiPhone/iPad Table controls based on a data file are not available in edit mode. TableModify cannot be used on Table controls based on a data file.

Row characteristics

  • Each row element is changed into the type of the associated column.
  • If one of the elements corresponds to an empty string ("") or to 0 (depending on the column type), its value will be overwritten.
    For example:
    TableModify(TABLE_TableClient, "Dubois" + TAB + "Pierre" + TAB + "" + ...
    		TAB + "21/06/72")
  • If an element corresponds to the calculation result, the numeric expression must be enclosed in brackets.
    For example:
    TableModify(TABLE_TableCalcul, (53+29) + TAB + (83-21))
  • To modify the value of an element in a row, use the following syntax:
    NomTable.NomColonne[IndiceLigne] = NouvelleValeur
WINDEVWEBDEV - Server codeJavaPHP

Table field/Hierarchical file table: Changes to the linked data file

If the cascading input is enabled, the data file linked to the control is automatically modified when the user goes to the next row.
If the cascading input is not enabled, the data file linked to the control is not modified. To write the record into the linked data file, TableSave must be called after TableModify.
Remarks:
  • The "Cascading input" option can be selected in the "Details" tab of the control description window.
  • Java The cascading input is not available for Table controls with direct access to the data source. This option is only available for Table controls populated programmatically and with in-memory data source.
  • WEBDEV - Server code Cascading input is only available for "Server + AJAX" Table controls based on a data file.

Changes in a Table or TreeView Table control based on a data file

To modify a row in a Table or TreeView Table control based on a data file, we advise you to:
WINDEVWEBDEV - Server codeJavaUser code (UMC)

Modifying a record in a Table control based on a data file and releasing a Trigger

You have the ability to activate a trigger when modifying a record in a Table control based on a data file. For more details, see the documentation about HDescribeTrigger.
WINDEVJava

TableModify function and Modified property

TableModify has no influence on the Modified property. The Modified property is used to know if the current row has been directly modified by the user (direct input in the control).
Component: wd300obj.dll
Minimum version required
  • Version 9
This page is also available for…
Comments
Click [Add] to post a comment

Last update: 09/21/2024

Send a report | Local help