{dialog.object}setFocus Method



{dialog.object}.setFocus(controlName, repeatingSectionRowNumber);



The control to set focus on.


Logical row number, must be specified if using a repeating section control.


Sets focus to a specified control on the dialog.

If the control is inside a tab or accordion, gives focus to the appropriate tab/accordion pane. If the control is in a Repeating Section, you must also specify the logical row number.


// set focus to the LASTNAME control

// set focus to the QUANTITY control in the 4th row of the repeating section:

Javascript Controls

The setFocus() Method works for Javascript controls (such as the List control) as well as HTML controls (such as a checkbox, textbox, etc). The motivation for adding support for Javascript controls to the .setFocus() method was to enable the following use case:

Assume you have a UX component with a List control on one Panel and some other controls on another Panel. The second Panel has a button that returns focus to the first Panel. However, when focus returns to the first Panel, pressing up and down keys (when running on a desktop browser) did not navigate in the List (even though visually, the List appeared to have focus). By using the .setFocus() method in the event handler for the button that returns focus to the first Panel, you can solve this problem.

See Also