DS Server

Javascript: TXTextControl.getActivationState Method

Method|Introduced in 28.0

Description

Gets a value indicating the current activation state. It can be activated, deactivated or disabled.

Syntax

<void> TXTextControl.getActivationState(<RequestActivationStateCallback> callback, [<ErrorCallback> errorCallback])

Parameters

ParameterDescription
callback

The callback function that receives the requested value.

errorCallback

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

Examples

The following example demonstrates TXTextControl.getActivationState in a practical document-editing workflow. It gets a value indicating the current activation state. It can be activated, deactivated or disabled.

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

TXTextControl.getActivationState(
    function(activationState) {
        if (!activationState) {
            console.warn("No activation state was returned.");
            return;
        }
        
        console.log("get activation state result:", activationState);
    },
    onTxError
);