(Windows only; Graphical interfaces only)
Applies to:
|
BROWSE widget, BUTTON widget, COMBO-BOX widget, CONTROL-FRAME widget, DIALOG-BOX widget, EDITOR widget, FILL-IN widget, FRAME widget, IMAGE widget, RADIO-SET widget, RECTANGLE widget, SELECTION-LIST widget, SLIDER widget, TEXT widget, TOGGLE-BOX widget
|
Specify an application-defined widget ID when you want to identify the widget at run time while testing your ABL GUI application with a third-party automated test tool. When specified, the AVM uses this application-defined widget ID when creating the widget at run time, instead of using the widget ID it normally generates by default. The widget ID value of any given widget remains the same across ABL sessions, unless you purposely change the value of the widget ID using this attribute. This allows a third-party automated test tool to identify the same widget consistently each time you run the tool with your application.
If you do not specify the Use Widget ID (–usewidgetid) startup parameter, and your application contains application-defined widget IDs, the AVM ignores any WIDGET-ID attribute or option settings and generates its own widget IDs. In this case, querying the WIDGET-ID attribute returns the Unknown value (
?).
If you specify the Use Widget ID (–usewidgetid) startup parameter and your application contains application-defined widget IDs, or a combination of application-defined and ABL-defined widget IDs, the AVM honors any application-defined widget IDs and assigns ABL-defined widget IDs as necessary. In this case, querying the WIDGET-ID attribute returns the assigned widget ID (whether it be an application-defined value or an ABL-defined value).
For frames, the AVM uses this attribute value as the basis for assigning a unique widget ID for each child widget within the frame by combining the frame widget ID with the child widget ID. For example, a frame defined with a widget ID of 100 that contains a fill-in widget defined with a widget ID of 2 results in a fill-in widget with a widget ID of 102 at run time. In this way, the widget ID of each child widget within a given frame is unique within that frame, as well as across multiple instances of that frame within a given window. If the value of the frame widget ID combined with the child widget ID is greater than 65534, the AVM displays a warning message and assigns a unique widget ID to the child widget.
When a frame is displayed as a down frame, you can specify an application-defined widget ID for the first instance of the widget on the down frame. The AVM assigns a unique widget ID for each additional instance of the widget on the down frame (based on the number of iterations in the down frame) using consecutive even numbers. Likewise, when a frame contains extent fields, the AVM assigns a widget ID to each of the extent elements in the frame.
Caution:
|
To avoid duplicate widget ID conflicts, within and across multiple instances of a widget in a single window, be sure to specify widget IDs within numeric ranges that take other widgets into account. For example, do not specify frame widget IDs in multiples of 10 when you have one or more frame widgets that contain more than 9 child widgets because it will result in a duplicate ID conflict.
|