PC SOFT

ONLINE HELP
FOR WINDEV, WEBDEV AND WINDEV MOBILE

Home | Sign in | English US
  • Overview
  • Operating mode, programming and synchronization of a Table on source control
  • Adding an element
  • Modifying an element
  • Deleting an element
  • Handling a Table control on source in a WLanguage code: stored value
  • Changing by programming the base variable of a Table control on source
  • Limitation
WINDEV
WindowsLinuxUniversal Windows 10 AppJavaReports and QueriesUser code (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Browser code
WINDEV Mobile
AndroidAndroid Widget iPhone/iPadApple WatchUniversal Windows 10 AppWindows Mobile
Others
Stored procedures
Overview
A Table control on source is a Table control whose columns are linked to the elements of an Array variable, to the members of a class or to the elements of an advanced variable (xlsDocument variable for example).
Each Table control column can be, for example:
  • Linked to a member of a class instance,
  • Linked to an array element, ...
  • Calculated: If the column is not linked to a variable, it is a calculated column. For the calculated columns, the content of the column is re-calculated whenever a row is displayed, it is not stored.
A Table on source control is used to:
  • View the content of an Array variable, the content of a class or the content of an advanced variable.
  • Handle a table row (addition, deletion, modification, ...).
Caution: the synchronization between the Table control and its source is not automatic. Depending on the action performed, the action must be applied to the table or to the source.
Versions 22 and later
Android This feature is now available for the Android applications.
New in version 22
Android This feature is now available for the Android applications.
Android This feature is now available for the Android applications.
Operating mode, programming and synchronization of a Table on source control

Adding an element

  • Case 1. Adding an element into the source of the Table control
    To carry over an addition performed in the source of the Table control, you must use TableDisplay associated with the taInit constant. The selection and the sort performed by the user are lost.
  • Case 2. Adding an element into the Table control (cascading input)
    To manage the cascading inputs, the additions must be performed by programming in the source.
    We advise you to:
    • Perform the additions one by one in the code used to exit from the row.
    • Use TableDisplay (associated with the taInit constant) to update the "links" between the rows of the Table control and the elements found in the source.

Modifying an element

  • Case 1. Modification in the source of the Table control
    To apply to the Table control the modifications performed on the source of the Table control, you must use TableDisplay.
  • Case 2. Modification performed in the Table control
    If the modifications are performed in the table directly, these modifications are automatically applied.
    If the modifications are performed in the Table control by programming, TableSave must be used to validate the modifications. Then, the modifications are automatically carried over.
    Caution: Depending on the operations that were previously performed, the carryover may be performed at a wrong location if the source and the Table control are out-of-synch: the synchronization must always be maintained.

Deleting an element

  • Case 1. Deleting an element according to its subscript from the source of the Table control
    The element must be deleted manually from the table and from the source.
    TableSeek is used to find out the row of the Table control corresponding to the element (the stored value of the Table control must correspond to the element of the source).
    Limitation: For the simple sources (array of integers for example), use TableDisplay associated with the taInit constant to update the "links" between the rows of the Table control and the elements found in the source. The selection and the sort performed by the user are lost.
  • Case 2. Deleting an element according to its subscript from the Table control
    The element must be deleted manually from the Table control and from the source.
    TableSeek is used to find out the subscript in the source corresponding to the element deleted from the Table control.
    Limitation: For the simple sources (array of integers for example), use TableDisplay associated with the taInit constant to update the "links" between the rows of the Table control and the elements found in the source. The selection and the sort performed by the user are lost.
Handling a Table control on source in a WLanguage code: stored value
When handling a Table control on source by programming:
  • using <Table Name> in the code returns the content of the stored item.
  • using <Table Name> in a FOR EACH LINE loop returns the content of the stored item.
  • using <Table Name> [n] in the code returns the content of the stored item.
Changing by programming the base variable of a Table control on source
To change via programming the base variable of a Table on source control:
  1. In the description window of the Table control, the type of filling for the Table control must be set to "by variable" ("Content" tab).
  2. By programming, define the value of the following properties for the Table control:
    • ..BrowsedFile: this property is used to define the name of the data source for the fill. In this case, this property corresponds to an array of structures or to the name of an array of classes.
    • ..StoredItem: this property corresponds to the value returned in memory by the Table control, when selecting a row.
  3. For each column in the Table control, use ..FileLink to define the name of the member of the array variable that will be used to fill the column found in the Table control.
  4. Display the data in the Table control with TableDisplay.
Example of code:
// Declare the array
STContact is Structure
sLastName is string
sFirstName is string
sEmail is string
END

t_Contact is array of STContact


// Assign the table properties
TABLE_CONTACT..BrowsedFile = ":t_Contact"
TABLE_CONTACT..StoredItem = ":t_Contact.sLastName"

// Assign the properties of the table columns
TABLE_CONTACT.COL_LASTNAME..FileLink = ":t_Contact.sLastName"
TABLE_CONTACT.COL_FIRSTNAME..FileLink = ":t_Contact.sFirstName"
TABLE_CONTACT.COL_EMAIL..FileLink = ":t_Contact.sEmail"

TableDisplay(TABLE_CONTACT)
Limitation
The Table controls based on a simple type array (integers, character strings, ...) are available in read-only.
Minimum required version
  • Version 14
This page is also available for…
Comments
  Can select the columns, which will not be exported
 Hoje Minha dica
é como colocar ou eliminar
Lupa nas colunas
Movimentar ou não as colunas
Tambem vou Mostrar Novidade No WinDev22
Poder selecionar as colunas, que não serão exportadas
//====================
My tip today
Is how to put or remove
Magnifying glass on the columns
Move or not the columns
I'll also Show What's New In WinDev22
Can select the columns, which will not be exported
//====================
Aujourd'hui Mon conseil
est comme mettre ou éliminer
Lupa dans les colonnes
Déplacer ou non les colonnes
Aussi montrera Nouveautés WinDev22
Vous pouvez sélectionner les colonnes qui ne seront pas exportés
//====================
http://windevdesenvolvimento.blogspot.com.br/2017/02/aula-1076-windev-tabela-048-bloquear-ou.html

https://www.youtube.com/watch?v=7S5k-jHUn9Y

De matos
Mar. 10 2017