Flipkart Search

Friday 15 May 2015

Set Initial focus on any ADF UI component

Often developers requires focus on a particular UI component on page load. ADF provides out-of-the-box feature for this problem. All you need is the exact component id of that element.
In this example I will show you how to move cursor to the input box used as a username input. This component was inside a bounded-taskflow exposed in a jspx region.
First the jspx code .

 <af:document id="d1" title="#{sessionScope.pageTitle}" 
partialTriggers="r1" initialFocusId="r1:0:sf1:it1">

This is our login module and now will try to find out its id generated on the webpage by developer tool.
We can now see the actual id of the UI component exposed in browser. It is the same ID we need to put in 

No comments:

Post a Comment