This content has been archived.

Table of Contents

setFocus: Public JS API for control actions

setFocus

Sets focus on a field identified by the target property.

Syntax

var options = {<br />
target: “Page1.prop1 ",<br />
rowIndex: {value: "
Page2.prop2", isProperty: true },<br />
event: eventObject<br />
};

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.

Suggest Edit

100% found this useful

Have a question? Get answers now.

Visit the Pega Support Community to ask questions, engage in discussions, and help others.