DS Server

SelectionFormField Object

Object|Introduced in 28.0

Description

The SelectionFormField objet represents a combobox or a drop-down list on a form. It can be initially empty and it can have a horizontal extension, when it is empty. Depending on whether it is editable, the SelectionFormField is either a combobox or a drop-down list.

Syntax

SelectionFormField

Examples

The following example demonstrates SelectionFormField in a practical document-editing workflow. The SelectionFormField objet represents a combobox or a drop-down list on a form. It can be initially empty and it can have a horizontal extension, when it is empty. Depending on whether it is editable, the SelectionFormField is either a combobox or a drop-down list.

function onTxError(error) {
    console.error("TX Text Control error:", error.msg);
    error.handled = true;
}

function inspectSelectionFormField(selectionFormField) {
    selectionFormField.getEmptyWidth(
        function(result) {
            console.log("get empty width result:", result);
        },
        onTxError
    );
}

Members

Methods

MethodDescription
getDescriptiveTextGets the form field's descriptive text. An empty string indicates that the link has no such text. (Inherited from FormField.)
getEmptyWidthGets the horizontal extension, in twips, of the selection formfield, when it is empty.
getEnabledGets a value indicating whether the form field is enabled. (Inherited from FormField.)
getIsDropDownArrowVisibleGets a value indicating whether a dropdown arrow is shown so that the user can select an item.
getItemsGets a list of items for the SelectionFormField. An item must not be an empty string.
getSelectedIndexGets the index of the selected item of the SelectionFormField. If the property value is -1, no item is selected and the currently selected item is deselected.
setDescriptiveTextSets the form field's descriptive text. An empty string or null can be used to delete a previously set text. (Inherited from FormField.)
setEmptyWidthSets the horizontal extension, in twips, of the selection formfield, when it is empty.
setEnabledSets a value indicating whether the form field is enabled. This property has only an effect, when the when the edit mode is set to TXTextControl.EditMode.ReadAndSelect and the allowEditingFormFields property of the document permissions has been set to true. In this case a Formfield can only be edited, when its Enabled property is true. When a FormField is disabled, the TextFieldClicked and TextFieldDoubleClicked of the Formfield are suppressed. The default value of this property is true. (Inherited from FormField.)
setIsDropDownArrowVisibleSets a value indicating whether a dropdown arrow is shown so that the user can select an item.
setItemsSets a list of items for the SelectionFormField. An item must not be an empty string.
setSelectedIndexSets the index of the selected item of the SelectionFormField. If the property value is -1, no item is selected and the currently selected item is deselected.