on 04-01-2016 6:57 AM
Hi Colleagues,
I have two pages called Page1 and Page2.
Page1 has "Submit" button.
After clicking of "Submit" button "Page2" will be getiing Rendered.
Page 2 has "Input" field.
After rendering of the "Page2" i wanna make focus on "Input" field but focus always stays on first element of the page that is "navButton".
Snippet Link: http://veui5infra.dhcp.wdf.sap.corp:8080/snippix/#6126
Please look into the snippet link and help me to change the focus on "Input Field"
Regards,
Suresh K
Hi Suresh,
At onAfterRendering event of your second page, try something like this:
var oInput = this.getView().byId("oInput"); //Get hold of the input that you want to focus on
jQuery.sap.delayedCall(0, null, function(){
oInput.focus();
});
Not able to see your snippet, since I don't belong to SAP Network.
Regards,
Sai Vellanki.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Suresh,
You can remove the delayedCall code and try plain like this:
var oInput = this.getView().byId("oInput");
oInput.focus();
Also, if you see in the delayedCall code, the first argument which is time I mentioned as '0' which is zero seconds. (Which will not make any difference in different browsers).
Regards,
Sai Vellanki.
User | Count |
---|---|
88 | |
23 | |
11 | |
9 | |
8 | |
5 | |
5 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.