FAQ: Why doesn't a change to a checkbox in a Python toolbox multivalue control cause parameter validation?
Why doesn't a change to a checkbox in a Python toolbox multivalue control cause parameter validation?
Consider a Python toolbox with a multivalue control. In tool dialog boxes there are two different user interface controls that are used for multivalues:
• A list of check boxes is used for fields and for strings, longs, and doubles, if they contain a ValueList filter. • All other data types display the standard multivalue parameter control.
If the form with check boxes is used, entries appear as strings with a check box to the left of them. The toolbox designer may wish to perform certain actions in the tool based on check boxes being checked or unchecked for the entries in this control.
Multivalue Control with ValueList filter
However, when the tool user toggles these check boxes, the toolbox UpdateParameters method is not called until the multivalue control loses the Windows focus; that is, the process is not updated until the user clicks somewhere else in the tool dialog, such as another control or the tool background, or tabs to another control. Thus the desired result actions cannot be performed at the time the check boxes are clicked.
This is 'as-designed' behavior; the designer cannot force UpdateParameters to be called when a check box in a multi-value tool parameter is toggled on or off. An alternate approach may be to implement the other form of multivalue control or a Value Table control.