Links may not function; however, this content may be relevant to outdated versions of the product.
setFocus: Public JS API for control actions
setFocus
Sets focus on a field identified by the target property.
Syntax
var options = {
target: “Page1.prop1 ",
rowIndex: {value: "Page2.prop2", isProperty: true },
event: eventObject
};
pega.api.ui.actions.setFocus(options);
Parameters
This API accepts a JavaScript object which can have the following key-values:
target: The fully qualified property name for the field that gets focused. If there are multiple fields with the same property reference, the first visible field gets focus. This is not required when setting focus to a row of active grid.
rowIndex: Optional. The row index when grid rows should be focused. When the index is set, the target is the data source associated with the grid whether it is a clipboard page, report definition or a data page. The index can be a constant or the name of property, the value of which indicates the index. When providing a constant value you can provide a numeric index or use keywords such as first or last.
event: Optional. The event refers to a DOM eventObject. This is required when setting focus on a grid row.