Showing posts with label document. Show all posts
Showing posts with label document. Show all posts

Thursday 7 December 2017

Set the Initial Focus on a component in a Page

In ADF, set the initialFocusId property of the af:document to set the focus on a Component on initial load  when the full page renders.

Note that if you are setting the initialFocusId to a component that is not normally available when rendered on the client, then you will also need to set the clientComponent attribute on that component to 'true'. Also, be aware that initialFocusId will be ignored when accessibility-mode is set to "screenReader"

You have to identify the ID of the component and set it for initialFocusId
Suggestion: Identifiers are relative to the component, and must account for NamingContainers. You can use a single colon to start the search from the root, or multiple colons to move up through the NamingContainers - "::" will pop out of the component's naming container and begin the search from there, ":::" will pop out of two naming containers and begin the search from there, etc.


<f:view>
  <af:document initialFocusId="<ID with relative path>">
   <af:form> ... </af:form>
  </af:document>
</f:view>

To identify the relative path of a component you can use developer toolbar in chorme and Firebug in Firefox (Right click on the component and select inspect element).

Ref: https://docs.oracle.com/html/E12419_09/tagdoc/af_document.html