DS Server

Javascript: TextViewGeneratorColors.getActiveFormFieldColor Method

Method|Introduced in 28.0

Description

Gets the highlight color of a form field containing the current text input position. If the property is not set, the return value is null.

Syntax

<void> TextViewGeneratorColors.getActiveFormFieldColor(<RequestStringCallback> callback, [<ErrorCallback> errorCallback])

Parameters

ParameterDescription
callback

Receives the highlight color.

errorCallback

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

Examples

The following example demonstrates TextViewGeneratorColors.getActiveFormFieldColor in a practical document-editing workflow. It gets the highlight color of a form field containing the current text input position. If the property is not set, the return value is null.

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

TXTextControl.displayColors.getActiveFormFieldColor(
    function(result) {
        console.log("get active form field color result:", result);
    },
    onTxError
);