AYUDA EN LÍNEA
 WINDEVWEBDEV Y WINDEV MOBILE

Ayuda / WLanguage / Funciones WLanguage / Controles, páginas y ventanas / Funciones Tabla
  • Use conditions
  • Características de los elementos de la fila
  • Position of the new row
  • Limits: Maximum number of lines displayed
  • Table field/Hierarchical file table: Changes to the linked data file
  • Table field/Hierarchical table file: Add multiple lines
  • Adding a record to a Table control based on a data file and releasing a trigger
  • Table or TreeView Table control based on a data file in edit mode
  • Agregar imágenes
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
Agrega una fila en:
  • un control Tabla,
  • un control Tabla TreeView.
Si la fila agregada es la primera fila del control, esta fila se convierte en la fila activa.
Observaciones:
Ejemplo
// Add "Moore" and "Vince"
// in the last row of the "TABLE_ProductTable" control
TableAddLine(TABLE_ProductTable, "Moore", "Vince")
WINDEVWEBDEV - Código Servidor
// Example of Table control
// with a "List of values" column (WEBDEV) or a "Combo box" column (WINDEV).
// This column can be filled in its description
// or programmatically.
// The example below processes the case programmatically.

// 1 - Adding possible values into the "List of values" or "Combo box" column
ListAdd(TABLE_MyTable.COL_Value, "Val 1")
ListAdd(TABLE_MyTable.COL_Value, "Val 2")
ListAdd(TABLE_MyTable.COL_Value, "Val 3")
ListAdd(TABLE_MyTable.COL_Value, "Val 4")

// 2 - Adding rows with elements selected 
// into the "List of values" or "Combo box" column
// the second column corresponds to the list values/combo box.
// Only the index to select in the list of values or combo box is specified.
TableAddLine(TABLE_MyTable, "row1", 1) // Where 1 corresponds to "Val 1"
TableAddLine(TABLE_MyTable, "row2", 4) // Where 4 corresponds to "Val 4"
Sintaxis
<Result> = TableAddLine(<Table control> [, <Element column 1> [... [, <Element column N>]]])
<Result>: Entero
  • Índice de la fila añadida,
  • -1 si se produce un error.
<Table control>: Nombre del control
Nombre del control a manipular. Este control puede corresponder a:
  • un control Tabla.
  • un control Tabla TreeView.
Si este parámetro corresponde a una cadena vacía (""), se utilizará el control al que pertenece el evento actual.
<Element column 1>: Tipo de columna asociada (opcional)
Elementos de la fila que se agregarán al control especificado. Cada elemento corresponde a una columna del control. El tipo del elemento agregado debe ser compatible con el tipo de la columna.
Si no se especifica ninguno de estos parámetros, se agrega una fila vacía al control. Para un control enlazado a datos, se tienen en cuenta los valores predeterminados definidos en el archivo de datos vinculado.
<Element column N>: Tipo de columna asociada (opcional)
Elementos de la fila que se agregarán al control especificado. Cada elemento corresponde a una columna del control. El tipo del elemento agregado debe ser compatible con el tipo de la columna.
Si no se especifica ninguno de estos parámetros, se agrega una fila vacía al control. Para un control enlazado a datos, se tienen en cuenta los valores predeterminados definidos en el archivo de datos vinculado.
Observaciones

Use conditions

TableAddLine 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 - Código ServidorPHP Reminder Multi-selection is not available for Table control fields in "Server" mode.
WEBDEV - Código ServidorPHP This function is available for Table controls in "Server" and "Server + AJAX" mode, and for TreeView Table controls.
WEBDEV - Código Navegador This function is available for Table controls in "Browser" mode only.
WEBDEV - Código Navegador The TreeView Table control is not available.
AndroidiPhone/iPad Table controls based on a data file are not available in edit mode. TableAddLine cannot be used on Table controls based on a data file.

Características de los elementos de la fila

  • Si no desea especificar un valor para un elemento, utilice una cadena vacía ("") o 0 (según el tipo de columna).
  • Si un elemento corresponde al resultado de un cálculo, encierre la expresión numérica entre paréntesis.
    Por ejemplo:
    TableAddLine(TABLE_CalcTable, (53+29), (83-21))

Position of the new row

By default, the row is added at the end of the rows displayed by the control.
Special case:
  • If the control is sorted by TableSort, the added row is positioned in the control according to the current sort.
  • If the control is sorted by the user, the sort is ignored when inserting the row. The row is added at the end of control.

Limits: Maximum number of lines displayed

The maximum number of rows that can be displayed in a TreeView Table control or hierarchical Table is limited only by available RAM (theoretical maximum: 2 billion rows).
However, we do not advise you to use large Table or TreeView Table controls for performance and user-friendliness reasons (time required to fill the control for example).
WINDEVWEBDEV - Código ServidorJavaPHP

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 content of the new row to the linked data file, TableSave must be used after TableAddLine.
Remarks:
  • The "Entrada en cascada (Agregar)" option can be selected in the "Details" tab of the control description.
  • 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 - Código Servidor Cascading input is only available for "Server + AJAX" Table controls based on a data file.
WINDEVWEBDEV - Código ServidorJavaPHP

Table field/Hierarchical table file: Add multiple lines

A virtual row is created each time TableAddLine is called in a Table or TreeView Table control based on a data file. The information will be saved in the linked data file only when TableSave is called.
If TableAddLine is successively called in the same process without being followed by TableSave, only the FIRST call is effective (the following calls are ignored). Only one row is added to the Table or TreeView Table control.
WEBDEV - Código ServidorPHP This operating mode is only available for "Server + AJAX" Table controls based on a data file.
WINDEVWEBDEV - Código ServidorJavaCódigo de Usuario (UMC)

Adding a record to a Table control based on a data file and releasing a trigger

A trigger can be released when a record is added in a Table control based on a data file. For more details, see the documentation about HDescribeTrigger.
WEBDEV - Código Servidor This operating mode is only available for "Server + AJAX" Table controls based on a data file.
WINDEVJavaCódigo de Usuario (UMC)

Table or TreeView Table control based on a data file in edit mode

If TableAddLine is called:
  • In a control event, the cursor is automatically positioned on the first editable column in the new row.
  • In an event that does not belong to the control (or in another process), SetFocusAndReturnToUserInput must be used to resume the input in the Table or TreeView Table control.

Agregar imágenes

Para agregar una imagen a una Tabla o Tabla TreeView:
  • WINDEV indique directamente el nombre y la ruta completa de la imagen que se agregará. Por ejemplo:
    TableAddLine(TABLE_MyTable, "C:\MyDocuments\MyImage.BMP")
  • WEBDEV - Código ServidorPHP indique la ruta y el nombre de la imagen que se agregará. La ruta es relativa al directorio "<Nombre_del_Proyecto>_WEB". Por ejemplo:
    // Adds the image found in the "WB_MyApp_WEB" directory
    TableAddLine(TABLE_MyTable, "MyImage.BMP")
Nota: Para que la imagen agregada se muestre correctamente, la columna debe ser de tipo Image.
Componente: wd300obj.dll
Versión mínima requerida
  • Versión 9
Esta página también está disponible para…
Comentarios
Video TableAddline
https://youtu.be/VzyIo0ra5C4
amarildo
21 12 2018
Exemplo TableAddLine
//Vou Mostrar como criar tabela
//Adicionando variavies

TableAddLine(TABLE_Manual,EDT_Codigo,EDT_Nome)
EDT_Codigo=0
EDT_Nome=""
ReturnToCapture(EDT_Codigo)

http://windevdesenvolvimento.blogspot.com.br/2017/01/aula-1032-tabela-040-criar-tabela-via.html

https://www.youtube.com/watch?v=plj3bvFu-vc
De matos
13 01 2017

Última modificación: 12/03/2025

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