Javascript: PageCollection.getItem Method
Description
Gets the Page containing the current text input position from the collection.
Syntax
<void> PageCollection.getItem(<RequestPageCallback> callback, [<ErrorCallback> errorCallback])Parameters
| Parameter | Description |
|---|---|
| callback | Receives the page at the current text input position. |
| errorCallback | Optional. Is called when the operation failed with an error. |
Examples
The following example demonstrates PageCollection.getItem in a practical document-editing workflow. It gets the Page containing the current text input position from the collection.
function onTxError(error) {
console.error("TX Text Control error:", error.msg);
error.handled = true;
}
TXTextControl.pages.getItem(
function(page) {
if (!page) {
console.warn("No page was returned.");
return;
}
console.log("get item result:", page);
},
onTxError
);