DS Server

Javascript: TextFormField.setEmptyWidth Method

Method|Introduced in 28.0

Description

Sets the horizontal extension, in twips, of the text formfield, when it is empty.

Syntax

<void> TextFormField.setEmptyWidth(<Number> emptyWidth, [<EmptyRequestCallback> callback], [<ErrorCallback> errorCallback])

Parameters

ParameterDescription
emptyWidth

Specifies the horizontal extension, in twips, of the text formfield, when it is empty. When this parameter is set to 0, a default value is used.

callback

Optional. Is called when the operation completed.

errorCallback

Optional. Is called when the operation failed with an error.

Examples

The following example demonstrates TextFormField.setEmptyWidth in a practical document-editing workflow. It sets the horizontal extension, in twips, of the text formfield, when it is empty.

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

function configureEmptyWidth(textFormField) {
    textFormField.setEmptyWidth(
        1440,
        function() {
            console.log("set empty width completed.");
        },
        onTxError
    );
}