TX Text Control .NET Server

Javascript: FrameCollection.getItemByName Method

Method|Introduced in 28.0

Description

Gets the frame with the specified name.

Syntax

<void> FrameCollection.getItemByName(<RequestFrameBaseCallback> callback, [<ErrorCallback> errorCallback], <string> name)

Parameters

ParameterDescription
callback

Receives the requested frame or null if no frame with the specified name exists.

errorCallback

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

name

The frame's name.

Examples

The following example demonstrates FrameCollection.getItemByName in a practical document-editing workflow. It gets the frame with the specified name.

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

function inspectItemByName(frames) {
    frames.getItemByName(
        function(frame) {
            if (!frame) {
                console.warn("No frame base was returned.");
                return;
            }
            
            console.log("get item by name result:", frame);
        },
        onTxError,
        "ApprovalStamp"
    );
}