Aller au contenu principal
Version: v20 R4 BETA

Data Source

Insertion automatique

Lorsque cette option est sélectionnée, si un utilisateur saisit une valeur introuvable dans la liste associée à l'objet, cette valeur est automatiquement ajoutée à la liste stockée en mémoire.

Lorsque l'option d'insertion automatique n'est pas définie (par défaut), la valeur saisie est stockée dans l'objet formulaire mais pas dans la liste en mémoire.

Cette propriété est prise en charge par :

Par exemple, pour une liste de choix contenant "France, Allemagne, Italie" associée à une combo box "Pays" : si la propriété d'insertion automatique est définie et qu'un utilisateur saisit "Espagne", la valeur "Espagne" est alors automatiquement ajoutée à la liste en mémoire :

Si la liste déroulante a été créée à partir d'une liste définie en mode Développement, la liste d'origine n'est pas modifiée.

Grammaire JSON

NomType de donnéesValeurs possibles
automaticInsertionbooleantrue, false

Objets pris en charge

Combo Box - Colonne List Box


Enumération

Associe une liste de choix à un objet. Il peut s'agir d'un nom de liste de choix (une référence de liste) ou d'une collection de valeurs par défaut.

You can also associate choice lists to objects using the OBJECT SET LIST BY NAME or OBJECT SET LIST BY REFERENCE commands.

Grammaire JSON

NomType de donnéesValeurs possibles
choiceListliste, collectionUne liste de valeurs possibles
listeliste, collectionUne liste de valeurs possibles (listes hiérarchiques uniquement)

Objets pris en charge

Drop-down List - Combo Box - Hierarchical List - List Box Column


Enumération (liste statique)

Liste de valeurs statiques à utiliser comme étiquettes pour l'objet onglet.

Grammaire JSON

NomType de donnéesValeurs possibles
labelsliste, collectionUne liste de valeurs à saisir dans l'onglet

Objets pris en charge

Onglets


Élément courant

Listbox de type collection ou entity selection

Indique une variable ou une expression qui se verra attribuer l'élément/l'entité de collection sélectionné(e) par l'utilisateur. Vous devez utiliser une variable objet ou une expression assignable qui accepte des objets. Si l'utilisateur ne sélectionne rien ou si vous avez utilisé une collection de valeurs scalaires, la valeur Null est affectée.

Cette propriété est en "lecture seule", elle est automatiquement mise à jour en fonction des actions de l'utilisateur dans la list box. Vous ne pouvez pas modifier sa valeur pour modifier l'état de sélection de la list box.

Grammaire JSON

NomType de donnéesValeurs possibles
currentItemSourcestringExpression d'objet

Objets pris en charge

List Box


Position élément courant

Listbox de type collection ou entity selection

Indique une variable ou une expression qui se verra attribuer un entier long indiquant la position de l'élément/l'entité de collection sélectionné(e) par l'utilisateur.

  • si aucun(e) élément/entité n'est sélectionné(e), la variable ou l'expression reçoit zéro,
  • si un(e) seul(e) élément/entité est sélectionné(e), la variable ou l'expression reçoit son emplacement,
  • si plusieurs éléments/entités sont sélectionnés, la variable ou l'expression reçoit la position de l'élément/entité qui a été sélectionné(e) en dernier.

    Cette propriété est en "lecture seule", elle est automatiquement mise à jour en fonction des actions de l'utilisateur dans la list box. Vous ne pouvez pas modifier sa valeur pour modifier l'état de sélection de la list box.

Grammaire JSON

NomType de donnéesValeurs possibles
currentItemPositionSourcestringExpression numérique

Objets pris en charge

List Box


Data Type (expression type)

Defines the data type for the displayed expression. This property is used with:

See also Expression Type section.

Grammaire JSON

NomType de donnéesValeurs possibles
dataSourceTypeHintstring
  • list box columns: "boolean", "number", "picture", "text", date", "time". Array/selection list box only: "integer", "object"
  • drop-down lists: "object", "arrayText", "arrayDate", "arrayTime", "arrayNumber"
  • Objets pris en charge

    Drop-down Lists associated to objects or arrays - List Box column


    Data Type (list)

    Defines the type of data to save in the field or variable associated to the drop-down list. This property is used with:

    Trois options sont 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 or SET 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.

    Grammaire JSON

    NomType de donnéesValeurs possibles
    saveAsstring"value", "reference"

    Setting only "dataSourceTypeHint" : "integer" with a "type": "dropdown" form object will declare a hierarchical drop-down list.

    Objets pris en charge

    Listes déroulantes associées aux listes


    Valeurs par défaut

    List of values that will be used as default values for the list box column (array type only). Ces valeurs seront automatiquement accessibles dans la variable tableau associée à la colonne lors de l’exécution du formulaire. 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.

    Vous devez saisir une liste de valeurs. 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.

    Grammaire JSON

    NomType de donnéesValeurs possibles
    valuescollectionA collection of default values (strings), ex: "a", "b", "c", "d"

    Objets pris en charge

    List Box Column (array type only)


    Expression

    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. You can enter:

    • 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. The following types of fields can be used:

      • String
      • Numeric
      • Date
      • Time
      • Picture
      • Boolean
        You can use fields from the Master Table or from other tables.
    • 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 and On 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:

      • String

      • Numeric

      • Date

      • Picture

      • Boolean

        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.

    Grammaire JSON

    NomType de donnéesValeurs possibles
    dataSourcestringA 4D variable, field name, or an arbitrary complex language expression.

    Objets pris en charge

    Colonne de list box


    Table principale

    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).

    Grammaire JSON

    NomType de donnéesValeurs possibles
    tablenumberNuméro de la table

    Objets pris en charge

    List Box


    Enregistrer comme

    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 or SET 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.

    Grammaire JSON

    NomType de donnéesValeurs possibles
    saveAsstring"value", "reference"

    Objets pris en charge

    Zone de saisie - Colonne List Box


    Eléments sélectionnés

    Listbox de type collection ou 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. Vous devez utiliser une variable objet ou une expression assignable qui accepte des objets.

      Cette propriété est en "lecture seule", elle est automatiquement mise à jour en fonction des actions de l'utilisateur dans la list box. Vous ne pouvez pas modifier sa valeur pour modifier l'état de sélection de la list box.

    Grammaire JSON

    NomType de donnéesValeurs possibles
    selectedItemsSourcestringCollection expression

    Objets pris en charge

    List Box


    Selection Name

    Named selection list boxes

    Specifies the named selection to be used. 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.

    Grammaire JSON

    NomType de donnéesValeurs possibles
    namedSelectionstringNom de la sélection

    Objets pris en charge

    List Box