跳到主要内容

SetCommitOnSelChange

Sets field commit on selection change prop.

Syntax

expression.SetCommitOnSelChange(bCommit);

expression - A variable that represents a ApiComboboxField class.

Parameters

NameRequired/OptionalData typeDefaultDescription
bCommitRequiredbooleanwill the field value be applied to all with the same name immediately after the change

Returns

boolean

Example

This example sets commit on selection change prop to field with list of options.

let doc = Api.GetDocument();
let page = doc.GetPage(0);
let comboboxField = Api.CreateComboboxField([10, 10, 160, 30]);
page.AddObject(comboboxField);

comboboxField.AddOption('Option 1');
comboboxField.AddOption('Option 2');
comboboxField.AddOption('Option 3');
comboboxField.SetCommitOnSelChange(true);
comboboxField.SetValue('Commit on sel change is: ' + comboboxField.IsCommitOnSelChange());