FAQ:  Why doesn't a change to a checkbox in a Python toolbox multivalue control cause parameter validation?

相关信息
Article ID: 41083
Software:
ArcGIS for Desktop Advanced 10.1
ArcGIS for Desktop Standard 10.1
ArcGIS for Desktop Basic 10.1
Platforms: N/A

问题描述
Why doesn't a change to a checkbox in a Python toolbox multivalue control cause parameter validation?
已邀请:

EsriSupport

赞同来自:

解决方案
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.


Multivalue Control





Value Table Control



创建及修改时间
Created: 4/1/2013

Last Modified: 8/6/2013
原文链接
http://support.esri.com/en/kno ... 41083

要回复问题请先登录注册