Setting or Activating a Key
For cloned controls, the clone and the children controls of the cloned control can be referenced by their Key property. When you create event link connections between controls in an automation, Studio displays a key parameter on control design blocks whenever a context exists. Here, the term context defines any instance of an target for which multiple instances can be created. The creation of keys and the setting of keys for objects is governed by the existence of contexts as follows.
Events set the context.
Event from No Context to a Context requires Key assignment.
Event from Context to Child Context requires Key assignment.
Event from Context to Parent Context does not require Key assignment.
Operations within the same context do not require Key assignment.
To assign a key, use either the Key property for the control or the ActivateOrSetNextKey method for the object. Normally you use the Created event to set the Key property. This makes sure the correct key is assigned to the corresponding control instance since the Created event is on the same thread used to set the Key property. Here is an example of the Key property.
The Key property accepts String input for the key. Here is an example of the ActivateOrSetNextKey method.
The ActivateOrSetNextKey method accepts one parameter (key). If a window is open that has that key already assigned, this method activates that window. If not, the method assigns that key to the next window of the correct typed opened.
Related information
Identifying Targets on MDI Child Windows
Using the Upstream Key/Override Key
Privacy | Trademarks | Terms of Use | Feedback
Updated: 01 July 2024
© 2016 - 2024 Pegasystems Inc. Cambridge, MA All rights reserved.