Javascript: FrameCollection.getItemByName Method
Description
Gets the frame with the specified name.
Syntax
<void> FrameCollection.getItemByName(<RequestFrameBaseCallback> callback, [<ErrorCallback> errorCallback], <string> name)Parameters
| Parameter | Description |
|---|---|
| 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"
);
}