Fuente de datos
Inserción automática
When this option is selected, if a user enters a value that is not found in the list associated with the object, this value is automatically added to the list stored in memory.
When the automatic insertion option is not set (default), the value entered is stored in the form object but not in the list in memory.
Esta propiedad es soportada por:
- Combo box and list box column form objects associated to a choice list.
- Combo box form objects whose associated list is filled by their array or object datasource.
Por ejemplo, dada una lista de selección que contiene "Francia, Alemania, Italia" que está asociada a un combo box "Países": si la propiedad inserción automática está activada y un usuario introduce "España", entonces el valor "España" se añade automáticamente a la lista en memoria:
If the choice list was created from a list defined in Design mode, the original list is not modified.
Gramática JSON
Nombre | Tipos de datos | Valores posibles |
---|---|---|
automaticInsertion | booleano | true, false |
Objetos soportados
Lista de selección
Asocia una lista de selección a un objeto. Puede ser un nombre de lista de elección (una referencia de lista) o una colección de valores por defecto.
You can also associate choice lists to objects using the OBJECT SET LIST BY NAME or OBJECT SET LIST BY REFERENCE commands.
Gramática JSON
Nombre | Tipos de datos | Valores posibles |
---|---|---|
choiceList | list, collection | Una lista de valores posibles |
lista | list, collection | Una lista de valores posibles (listas jerárquicas únicamente) |
Objetos soportados
Drop-down List - Combo Box - Hierarchical List - List Box Column
Lista de selección (lista estática)
Lista de valores estáticos a utilizar como etiquetas para el objeto de control de pestañas.
Gramática JSON
Nombre | Tipos de datos | Valores posibles |
---|---|---|
labels | list, collection | Una lista de valores para llenar el control de pestañas |
Objetos soportados
Elemento actual
List boxes colección o entity selection
Especifica una variable o expresión a la que se asignará el elemento/entidad de la colección seleccionado por el usuario. Debe utilizar una variable objeto o una expresión asignable que acepte objetos. Si el usuario no selecciona nada o si ha utilizado una colección de valores escalares, se asigna el valor Null.
Esta propiedad es de "sólo lectura", se actualiza automáticamente según las acciones del usuario en el list box. No se puede editar su valor para modificar el estado de selección del list box.
Gramática JSON
Nombre | Tipos de datos | Valores posibles |
---|---|---|
currentItemSource | cadena | Expresión del objeto |
Objetos soportados
Posición elemento actual
List boxes colección o entity selection
Indica una variable o expresión a la que se le asignará un entero largo que indica la posición del elemento/entidad de colección seleccionado por el usuario.
- si no se selecciona ningún elemento/entidad, la variable o expresión recibe cero,
- si se selecciona un solo elemento/entidad, la variable o expresión recibe su ubicación,
- si se seleccionan varios elementos/entidades, la variable o expresión recibe la posición del elemento/entidad que se seleccionó de última.
Esta propiedad es de "sólo lectura", se actualiza automáticamente según las acciones del usuario en el list box. No se puede editar su valor para modificar el estado de selección del list box.
Gramática JSON
Nombre | Tipos de datos | Valores posibles |
---|---|---|
currentItemPositionSource | cadena | Expresión numérica |
Objetos soportados
Data Type (expression type)
Defines the data type for the displayed expression. This property is used with:
- List box columns of the selection and collection types.
- Drop-down lists associated to objects or arrays.
See also Expression Type section.
Gramática JSON
Nombre | Tipos de datos | Valores posibles |
---|---|---|
dataSourceTypeHint | cadena |
Objetos soportados
Drop-down Lists associated to objects or arrays - List Box column
Tipo de datos (lista)
Defines the type of data to save in the field or variable associated to the drop-down list. This property is used with:
- Drop-down lists associated to a choice list.
- Drop-down lists associated to a hierarchical choice list.
Hay tres opciones disponibles:
- List reference: declares that the drop-down list is hierarchical. It means that the drop-down list can display up to two hierarchical levels and its contents can be managed by the 4D language commands of the Hierarchical Lists theme.
- Selected item value (default): the drop-down list is not hierarchical and the value of the item chosen in the list by the user is saved directly. For example, if the user chooses the value "Blue", then this value is saved in the field.
- Selected item reference: the drop-down list is not hierarchical and the reference of the choice list item is saved in the object. This reference is the numeric value associated with each item either through the itemRef parameter of the
APPEND TO LIST
orSET LIST ITEM
commands, or in the list editor. This option lets you optimize memory usage: storing numeric values in fields uses less space than storing strings. It also makes it easier to translate applications: you just create multiple lists in different languages but with the same item references, then load the list based on the language of the application.
Using the Selected item reference option requires compliance with the following principles:
- To be able to store the reference, the field or variable data source must be of the Number type (regardless of the type of value displayed in the list). The expression property is automatically set.
- Valid and unique references must be associated with list items.
- The drop-down list must be associated with a field or a variable.
Gramática JSON
Nombre | Tipos de datos | Valores posibles |
---|---|---|
saveAs | cadena | "value", "reference" |
Setting only
"dataSourceTypeHint" : "integer"
with a"type": "dropdown"
form object will declare a hierarchical drop-down list.
Objetos soportados
Drop-down Lists associated to lists
Valores por defecto (lista de)
List of values that will be used as default values for the list box column (array type only). These values are automatically available in the array variable associated with this column when the form is executed. Using the language, you can manage the object by referring to this array.
Do not make confusion between this property and the "default value" property that allows to define a field value in new records.
Debe introducir una lista de valores. In the Form editor, a specific dialog box allows you to enter values separated by carriage returns:
You can also define a choice list with the list box column. However, a choice list will be used as list of selectable values for each column row, whereas the default list fill all column rows.
Gramática JSON
Nombre | Tipos de datos | Valores posibles |
---|---|---|
values | colección | A collection of default values (strings), ex: "a", "b", "c", "d" |
Objetos soportados
List Box Column (array type only)
Expresión
This description is specific to selection and collection type list box columns. See also Variable or Expression section.
A 4D expression to be associated with a column. Puede introducir:
A simple variable (in this case, it must be explicitly declared for compilation). You can use any type of variable except BLOBs and arrays. The value of the variable will be generally calculated in the
On Display Detail
event.A field using the standard [Table]Field syntax (selection type list box only), for example:
[Employees]LastName
. Se pueden utilizar los siguientes tipos de campos:- Cadena
- Numeric
- Fecha
- Hora
- Imagen
- Boolean
Puede utilizar campos de la tabla maestra o de otras tablas.
A 4D expression (simple expression, formula or 4D method). The expression must return a value. The value will be evaluated in the
On Display Detail
andOn Data Change
events. The result of the expression will be automatically displayed when you switch to Application mode. The expression will be evaluated for each record of the selection (current or named) of the Master Table (for selection type list boxes), each element of the collection (for collection type list boxes) or each entity of the selection (for entity selection list boxes). If it is empty, the column will not display any results.
The following expression types are supported:- Cadena
- Numeric
- Fecha
- Imagen
- Booleano
For collection/entity selection list boxes, Null or unsupported types are displayed as empty strings.
When using collections or entity selections, you will usually declare the element property or entity attribute associated to a column within an expression containing This.This
is a dedicated 4D command that returns a reference to the currently processed element. For example, you can use This.<propertyPath> where <propertyPath> is the path of a property in the collection or an entity attribute path to access the current value of each element/entity.
If you use a collection of scalar values, 4D will create an object for each collection element with a single property (named "value"), filled with the element value. In this case, you will use This.value as expression.If a non-assignable expression is used (e.g.
[Person]FirstName+" "+[Person]LastName
), the column is never enterable even if the Enterable property is enabled.
If a field, a variable, or an assignable expression (e.g. Person.lastName) is used, the column can be enterable or not depending on the Enterable property.
Gramática JSON
Nombre | Tipos de datos | Valores posibles |
---|---|---|
dataSource | cadena | Una variable 4D, un nombre de campo o una expresión del lenguaje compleja arbitraria. |
Objetos soportados
Tabla principal
Current selection list boxes
Specifies the table whose current selection will be used. This table and its current selection will form the reference for the fields associated with the columns of the list box (field references or expressions containing fields). Even if some columns contain fields from other tables, the number of rows displayed will be defined by the master table.
All database tables can be used, regardless of whether the form is related to a table (table form) or not (project form).
Gramática JSON
Nombre | Tipos de datos | Valores posibles |
---|---|---|
tabla | number | Número de tabla |
Objetos soportados
Guardar como
This property is available in the following conditions:
- a choice list is associated with the object
- for inputs and list box columns, a required list is also defined for the object (both options should use usually the same list), so that only values from the list can be entered by the user.
This property specifies, in the context of a field or variable associated with a list of values, the type of contents to save:
- Save as Value (default option): the value of the item chosen in the list by the user is saved directly. For example, if the user chooses the value "Blue", then this value is saved in the field.
- Save as Reference: the reference of the choice list item is saved in the object. This reference is the numeric value associated with each item either through the itemRef parameter of the
APPEND TO LIST
orSET LIST ITEM
commands, or in the list editor.
This option lets you optimize memory usage: storing numeric values in fields uses less space than storing strings. It also makes it easier to translate applications: you just create multiple lists in different languages but with the same item references, then load the list based on the language of the application.
Using this property requires compliance with the following principles:
- To be able to store the reference, the field or variable data source must be of the Number type (regardless of the type of value displayed in the list). The expression property is automatically set.
- Valid and unique references must be associated with list items.
Gramática JSON
Nombre | Tipos de datos | Valores posibles |
---|---|---|
saveAs | cadena | "value", "reference" |
Objetos soportados
Elementos seleccionados
List boxes colección o entity selection
Specifies a variable or expression that will be assigned the elements or entities selected by the user.
- for a collection list box, you must use a collection variable or an assignable expression that accepts collections,
- for an entity selection list box, an entity selection object is built. Debe utilizar una variable objeto o una expresión asignable que acepte objetos.
Esta propiedad es de "sólo lectura", se actualiza automáticamente según las acciones del usuario en el list box. No se puede editar su valor para modificar el estado de selección del list box.
Gramática JSON
Nombre | Tipos de datos | Valores posibles |
---|---|---|
selectedItemsSource | cadena | Collection expression |
Objetos soportados
Selección de nombres
Named selection list boxes
Especifica la selección con nombre que se utilizará. You must enter the name of a valid named selection. It can be a process or interprocess named selection. The contents of the list box will be based on this selection. The named selection chosen must exist and be valid at the time the list box is displayed, otherwise the list box will be displayed blank.
Named selections are ordered lists of records. They are used to keep the order and current record of a selection in memory. For more information, refer to Named Selections section in the 4D Language Reference manual.
Gramática JSON
Nombre | Tipos de datos | Valores posibles |
---|---|---|
namedSelection | cadena | Nombre de la selección |