DS Server

Javascript: SelectionFormField.getEmptyWidth Method

Method|Introduced in 28.0

Description

Gets the horizontal extension, in twips, of the selection formfield, when it is empty.

Syntax

<void> SelectionFormField.getEmptyWidth(<RequestNumberCallback> callback, [<ErrorCallback> errorCallback])

Parameters

ParameterDescription
callback

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

errorCallback

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

Examples

The following example demonstrates SelectionFormField.getEmptyWidth in a practical document-editing workflow. It gets the horizontal extension, in twips, of the selection formfield, when it is empty.

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

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