DS Server

ApplicationField Object

Object|Introduced in 25.0

Description

Represents a ApplicationField. Is used as the callback function argument for the getTextFields method and as a parameter for the addTextField method, for example.

Syntax

TXTextControl.ApplicationField

Examples

The following example demonstrates TXTextControl.ApplicationField in a practical document-editing workflow. It represents a ApplicationField. Is used as the callback function argument for the getTextFields method and as a parameter for the addTextField method, for example.

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

TXTextControl.textParts.getMainText(function(mainText) {
    const applicationFields = mainText.applicationFields;
    applicationFields.getItem(function(applicationField) {
        if (!applicationField) {
            console.warn("No application field is available at the current input position.");
            return;
        }
    
        applicationField.getFormat(
            function(result) {
                console.log("get format result:", result);
            },
            onTxError
        );
    }, onTxError);
}, onTxError);

Members

Constructors

ConstructorDescription
ApplicationFieldInitializes a new instance of the ApplicationField class.
TextFieldInitializes a new instance of the TextField class. (Inherited from TXTextControl.TextField.)

Properties

PropertyDescription
boundsObsolete. This property will be removed in one of the next versions. The bounding rectangle of a text field. The bounding rectangle is the smallest rectangle which contains all characters of the field's text. (Inherited from TXTextControl.TextField.)
containsInputPositionObsolete. This property will be removed in one of the next versions. Returns true if the Textfield contains the current text input position. (Inherited from TXTextControl.TextField.)
deleteableObsolete. This property will be removed in one of the next versions. Specifies whether a text field can be deleted by the end-user while a TX Text Control document is being edited. (Inherited from TXTextControl.TextField.)
doubledInputPositionObsolete. This property will be removed in one of the next versions. Specifies whether a text field has a doubled input position in front of its first character and behind its last character. (Inherited from TXTextControl.TextField.)
editableObsolete. This property will be removed in one of the next versions. Specifies whether the text of a text field can be changed by the end-user while a TX Text Control document is being edited. (Inherited from TXTextControl.TextField.)
idObsolete. This property will be removed in one of the next versions. The identifier of the text field. (Inherited from TXTextControl.TextField.)
isSpellCheckingEnabledObsolete. This property will be removed in one of the next versions. Specifies whether a text field's text is checked on misspelled words. (Inherited from TXTextControl.TextField.)
lengthObsolete. This property will be removed in one of the next versions. The number of characters in the text field. (Inherited from TXTextControl.TextField.)
nameObsolete. This property will be removed in one of the next versions. The Text field's name. (Inherited from TXTextControl.TextField.)
parametersThe ApplicationField's parameters.
showActivatedObsolete. This property will be removed in one of the next versions. Specifies whether a text field toggles its background to gray, if the current input position is in the field. (Inherited from TXTextControl.TextField.)
startObsolete. This property will be removed in one of the next versions. The 1-based first character position of the text field. (Inherited from TXTextControl.TextField.)
textObsolete. This property will be removed in one of the next versions. The Text field's text. (Inherited from TXTextControl.TextField.)
typeObsolete. This property will be removed in one of the next versions. The field type ("APPLICATIONFIELD" or "TEXTFIELD"). (Inherited from TXTextControl.TextField.)
typeNameThe merge field type ("MERGEFIELD", "DATE", "IF" etc.).

Methods

MethodDescription
showDialogDisplays a merge field dialog for certain merge field types.