Javascript: SelectionFormField.setItems Method
Description
Sets a list of items for the SelectionFormField. An item must not be an empty string.
Syntax
<void> SelectionFormField.setItems(<String[]> items, [<EmptyRequestCallback> callback], [<ErrorCallback> errorCallback])Parameters
| Parameter | Description |
|---|---|
| items | A list of items for the SelectionFormField. |
| callback | Optional. Is called when the operation completed. |
| errorCallback | Optional. Is called when the operation failed with an error. |
Examples
The following example demonstrates SelectionFormField.setItems in a practical document-editing workflow. It sets a list of items for the SelectionFormField. An item must not be an empty string.
function onTxError(error) {
console.error("TX Text Control error:", error.msg);
error.handled = true;
}
function configureItems(selectionFormField) {
selectionFormField.setItems(
["Low", "Medium", "High"],
function() {
console.log("set items completed.");
},
onTxError
);
}