DS Server

Javascript: TextField.setHighlightMode Method

Method|Introduced in 28.0

Description

Sets a value indicating when the text field is highlighted.

Syntax

<void> TextField.setHighlightMode(<HighlightMode> highlightMode, [<EmptyRequestCallback> callback], [<ErrorCallback> errorCallback])

Parameters

ParameterDescription
highlightMode

Indicates when the text field is highlighted.

callback

Optional. Is called when the operation completed.

errorCallback

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

Examples

The following example demonstrates TextField.setHighlightMode in a practical document-editing workflow. It sets a value indicating when the text field is highlighted.

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

function configureHighlightMode(textField) {
    textField.setHighlightMode(
        TXTextControl.HighlightMode.Always,
        function() {
            console.log("set highlight mode completed.");
        },
        onTxError
    );
}