DS Server

Javascript: Selection.isCommonPargraphFormatValueSelected Method

Method|Introduced in 24.0

Description

Informs about whether an attribute from the ParagraphFormat.Attribute enumeration has the same value for the complete selection.

Syntax

<void> Selection.isCommonPargraphFormatValueSelected(<ParagraphFormat.Attribute> paragraphFormatAttribute, [<EmptyRequestCallback> callback], [<ErrorCallback> errorCallback])

Parameters

ParameterDescription
paragraphFormatAttribute

Specifies a possible value from the enumeration.

callback

Optional. Is called when the operation completed.

errorCallback

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

Examples

The following example demonstrates Selection.isCommonPargraphFormatValueSelected in a practical document-editing workflow. Informs about whether an attribute from the ParagraphFormat.Attribute enumeration has the same value for the complete selection.

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

function isCommonPargraphFormatValueSelected(paragraphFormatAttribute) {
    TXTextControl.selection.isCommonPargraphFormatValueSelected(
        paragraphFormatAttribute,
        function() {
            console.log("is common pargraph format value selected completed.");
        },
        onTxError
    );
}