Show TOC

Focus Handling in Browser Locate this document in the navigation structure

 

If no UI element is deleted, added, or replaced during a server round trip, the Web Dynpro ABAP Framework resets the focus to the UI element on which the focus was set before the roundtrip. Alternatively, the application can set the focus explicitly to a specific UI element. IF_WD_VIEW->REQUEST_FOCUS_ON_VIEW_ELEM is available for this, for example.

Messages

If new messages are opened in the message area, the focus there is set to the first message, even if the application wants to set the focus elsewhere.

Keyboard Handling

It is important for keyboard handling and for accessibility that the focus is in the correct place. If the application replaces, creates, or deletes UI elements, it should always ensure that the focus is in the correct place.

More Information: activateAccessKey

Recommendations for Standard Focus Position on User Interfaces

Within the Accessibility mode, you do not have to set the focus explicitly on the title of a dialog box for it to satisfy accessibility requirements. Users who use screen readers want to work through application screens in the same way other users do. Hence the position of the focus is the same. With HTML dialogs in the browser the focus is set on the Title UI element when it moves over the dialog box. If accessibility mode is not set, the focus is not set on the title. This is the only difference between the accessibilty non-accessbility modes.

Standard Focus for Dialog Boxes
  • Messages

    • On the message dialog box set the standard focus on the Button that closes the message dialog box.

    • If the message dialog box receives an interactive list of messages, set the focus on the list. Make the Button that closes the messages available as a standard Button. Use the Enter button in the list to select entries from the list.

  • Dialog boxes with editable content

    • Set the standard focus on the first interactive UI element

    • Set the standard focus on the most frequently used UI element

    • Set the standard focus primarily on UI elements like InputField, DropDownByKey, DropDownByIdx, CheckBox, RadioButton

  • Dialog boxes with read-only content

    • Set the standard focus on the first read-only UI element, if it is likely that the read-only content is needed for copy and pasting.

    • Set the standard focus on the Button that closes the dialog box.

  • Dialog boxes with read-only content

    Set the standard focus on the Button that closes the dialog box.

Standard Focus for Applications and Within Complex UI Elements
  • Set the standard focus within the primary editing area

  • Set the focus, but no standard selection

  • As soon as the user changes the focus, the UI element newly focussed on should be automatically selected. If the user continues the focus navigation, each entry focussed on should be automatically selected. The previously focussed (and therefore selected) entry will be deselected.

  • Provide functionality for explicit selection and deselection, if possible using one toggle function, such as [space].

  • Also provide a function to change the focus explicitly, without moving the selection changes.

Range of the Standard Focus

Set the standard focus primarily on UI elements, such as:

  • Standard Button

  • InputField

  • RadioButton

  • CheckBox

  • DropDownByKey and DropDownByIndex

  • Table

  • Tree

  • other UI elements used for editing data

The standard focus should not be on these UI elements:

  • Button (except for the standard button)

  • Link UI elements

  • Image

  • Label

  • ToolBar contents

Standard Focus for Complex UI Elements

With complex UI elements the standard focus is usually on the first entry. The first entry is focussed on, but not selected. After focus navigation, the next entry focussed on is automatically selected. If the content of the UI element is then updated (in the background), the already selected entry should remain as the selected entry. If entries are inserted above the selected entry, the selection remains on this entry even though the entry is moved further down.

After a server roundtrip the selected entry should remain as the selected entry. The application should make the focused UI element persistent as well as the selection within the focused UI element. When the server roundtrip returns, the previously focused UI element should be focused on again, and the focus should remain on the entry last selected (multiple selection), or on the selected entry (multiple selection).