4D v14.3LISTBOX DUPLICATE COLUMN |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
4D v14.3
LISTBOX DUPLICATE COLUMN
|
LISTBOX DUPLICATE COLUMN ( {* ;} object ; colPosition ; colName ; colVariable ; headerName ; headerVar {; footerName ; footerVar} ) | ||||||||
Parameter | Type | Description | ||||||
* | Operator |
![]() |
If specified, object is an object name (string) If omitted, object is a variable | |||||
object | Form object |
![]() |
Object name (if * is specified) or Variable (if * is omitted) of the column to be duplicated | |||||
colPosition | Longint |
![]() |
Location of new duplicated column | |||||
colName | String |
![]() |
Name of new column | |||||
colVariable | Array, Field, Variable |
![]() |
Name of the column array variable or field or variable | |||||
headerName | String |
![]() |
Column header object name | |||||
headerVar | Integer variable |
![]() |
Column header variable | |||||
footerName | String |
![]() |
Column footer object name | |||||
footerVar | Variable |
![]() |
Column footer variable | |||||
The LISTBOX DUPLICATE COLUMN command duplicates the column designated by the object and * parameters by programming in the context of the form being executed (Application mode). The original form, generated in the Design mode, is not modified.
Note: This functionality was already found in 4D, in Design mode only, using the Duplicate Column command found in the context menu of the Form editor.
By default, all style options (size, color, formats, etc.) set for the source column by means of the Property list or using object management commands (OBJECT SET COLOR, etc.) are applied to the copy. The object method and the settings of the form events are also duplicated.
However, the data source (array or selection, depending on the source type set for the list box) as well as the style and color arrays are not duplicated. It is your responsibility to define them for each new column after duplication.
The object and * parameters designate the column to duplicate. Passing the optional * parameter indicates that the object parameter is an column name (string). If you do not pass this parameter, it indicates that the object parameter is a column variable. In this case, you pass a variable reference instead of a string.
Note: This command does nothing when it is applied to the first column of a list box displayed in hierarchical mode.
The new duplicated column is placed just before the column designated by the colPosition parameter. If the colPosition parameter is greater than the total number of columns, then the duplicated column is placed after the last column.
In the colName and colVariable parameters, pass the object name and the variable of the new duplicated column.
Remember that the data source of the original column is not duplicated: you must set a source variable, array or field for the new duplicated column.
In the headerName and headerVariable parameters, pass the object name and variable for the header of the new duplicated column. You can also pass the object name and variable for the footer of the inserted column in the footerName and footerVariable parameters. If you omit the footerVariable parameter, 4D uses a dynamic variable.
Note: Object names must be unique in a form. You must make sure that the names passed in the colName, headerName and footerName parameters have not already been used. Otherwise, the column is not duplicated and an error is generated.
This command must be used in the context of displaying a form. It is usually called in the On Load form event or following a user action (On Clicked event).
In an array type list box, we want to duplicate the "First Name" column, ready for input:
Here is the code of the button:
ARRAY TEXT(arrFirstNames2;Records in table([Members]))
LISTBOX DUPLICATE COLUMN(*;"column2";3;"col2bis";arrFirstNames2;"FirstNameA";vHead2A)
OBJECT SET TITLE(*;"FirstNameA";"Middle Name")
EDIT ITEM(*;"col2A";0)
When you click on the button, the list box appears as follows:
Product: 4D
Theme: List Box
Number:
1273
Created: 4D v14
4D Language Reference ( 4D v14 R2)
4D Language Reference ( 4D v14.3)
Parent of : LISTBOX DUPLICATE COLUMN ( 4D v14 R3)