Javascript: EditableRegion.setUserName Method
Description
Sets the name of the user who can edit the region. This parameter can be null or an empty string to indicate, that no user name has been specified and the region can be edited by everyone.
Syntax
<void> EditableRegion.setUserName(<string> username, [<EmptyRequestCallback> callback], [<ErrorCallback> errorCallback])Parameters
| Parameter | Description |
|---|---|
| username | The name of the user who can edit the region. |
| callback | Optional. Is called when the operation completed. |
| errorCallback | Optional. Is called when the operation failed with an error. |
Examples
The following example demonstrates EditableRegion.setUserName in a practical document-editing workflow. It sets the name of the user who can edit the region. This parameter can be null or an empty string to indicate, that no user name has been specified and the region can be edited by everyone.
function onTxError(error) {
console.error("TX Text Control error:", error.msg);
error.handled = true;
}
function configureUserName(editableRegion) {
editableRegion.setUserName(
"Tim Typer",
function() {
console.log("set user name completed.");
},
onTxError
);
}