Skip to main content
Version: v19 R8 BETA

Combo Box

Um combo box é parecido com uma lista drop-down, exceto que aceita texto digitado do teclado e tem opções adicionais.

Fundamentally, you treat a combo box as an enterable area that uses its object, array or a choice list as the set of default values.

Handling combo boxes

Use the On Data Change event to manage entries into the enterable area, as you would for any input form object.

You initialize a combo box in exactly the same way as a drop-down list: using an object, an array, or a choice list.

Utilização de um objecto

This feature is only available in 4D projects.

An object encapsulating a collection can be used as the data source of a combo box. The object must contain the following properties:

PropriedadeTipoDescrição
valuesCollectionMandatory - Collection of scalar values. All values must be of the same type. Supported types:
  • strings
  • números
  • datas
  • horas
  • If empty or not defined, the combo box is empty
    currentValuesame as CollectionText entered by the user

    If the object contains other properties, they are ignored.

    When the user enters text into the combo box, the currentValue property of the object gets the entered text.

    Usar um array

    Please refer to Using an array in the drop-down list page for information about how to initialize the array.

    When the user enters text into the combo box, the 0th element of the array gets the entered text.

    Utilizar uma lista de seleção

    If you want to use a combo box to manage the values of an input area (listed field or variable), 4D lets you reference the field or variable directly as the form object's data source. Isso facilita gerenciar variáveis/campos listados.

    Se usar uma lista hierárquica, só o primeiro nível é mostrado e pode ser selecionado.

    To associate a combo box with a field or variable, you can just enter the name of the field or variable directly in the Variable or Expression of the form object in the Property List.

    When the form is executed, 4D automatically manages the combo box during input or display: when a user chooses a value, it is saved in the field; this field value is shown in the combo box when the form is displayed:

    Please refer to Using a choice in the drop-down list page for more information.

    Options

    Combo box type objects accept two specific options:

    • Automatic insertion: enables automatically adding a value to the data source when a user enters a value that is not found in the list associated with the combo box.
    • Excluded List (lista de valores excluídos): permite estabelecer uma lista cujos valores não podem ser digitados na combo box. Se um valor excluído for digitado, não será aceito e uma mensagem de erro é exibido.

      Associating a list of required values is not available for combo boxes. In an interface, if an object must propose a finite list of required values, then you must use a drop-down list object.

    Propriedades compatíveis

    Alpha Format - Bold - Bottom - Choice List - Class - Date Format - Expression Type - Font - Font Color - Font Size - Height - Help Tip - Horizontal Sizing - Italic - Left - Object Name - Right - Time Format - Top - Type - Underline - Variable or Expression - Vertical Sizing - Visibility - Width