Saltar para o conteúdo principal
Versão: 20 R5 BETA

Combo Box

A combo box is similar to a drop-down list, except that it accepts text entered from the keyboard and has additional options.

Em outros aspectos, você deve tratar uma combo box como uma área editável que usa seu array ou uma lista de escolha como um conjunto de valores padrão.

Gestão do 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

Esta funcionalidade só está disponível em projectos 4D.

An object encapsulating a collection can be used as the data source of a combo box. O objeto deve conter as seguintes propriedades:

PropriedadeTipoDescrição
valoresCollectionObrigatório - Coleção de valores escalares. Todos os valores devem ser do mesmo tipo. Supported types:
  • strings
  • numbers
  • dates
  • times
  • If empty or not defined, the combo box is empty
    currentValueigual a ColecçãoTexto introduzido pelo usuário

    Se o objeto contiver outras propriedades, estas são ignoradas.

    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.

    Um combo box é iniciado em exatamente da mesma forma que uma lista drop down Se o usuário digitar texto em uma combo box, preenche o 0imo elemento do array.

    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.

    Opções

    Objetos do tipo combo box aceitam duas opções específicas referentes a listas de escolhas associadas com elas:

    • 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 (list of excluded values): allows setting a list whose values cannot be entered in the 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