TX Text Control .NET Server

Javascript: TextFrame.activate Method

Method|Introduced in 28.0

Description

Activates the text frame. The text frame receives the input focus. A text frame can only be activated, if the text part that contains the text frame has the input focus.

Syntax

<void> TextFrame.activate([<RequestBooleanCallback> callback], [<ErrorCallback> errorCallback])

Parameters

ParameterDescription
callback

Optional. Receives whether the text frame could be activated.

errorCallback

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

Examples

The following example demonstrates TextFrame.activate in a practical document-editing workflow. It activates the text frame. The text frame receives the input focus. A text frame can only be activated, if the text part that contains the text frame has the input focus.

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

function activate(textFrame) {
    textFrame.activate(
        function(result) {
            if (result) {
                console.log("activate is available.");
            } else {
                console.warn("activate is not available in the current document state.");
            }
        },
        onTxError
    );
}