on 2017 Feb 08 6:33 AM
Hi All,
We have a requirement wherein on a page , there is a simple form with 4 input fields. On page load, requirement is to set cursor on first input field. We have an XML view, and in controller, in HandleRouteMatched, have written something like this,
this.getView().byId("<Input Field ID>").focus();
however its not working. Please suggest ways to achieve it.
Thanks and regards,Ruchi Agarwal
You could try this
jQuery.sap.delayedCall(0, this, function() {
this.byId("<Input Field ID>").focus()
});
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Works. I applied this in an input with event change to jump to another field:
view.xml:
<Input id='in_werks' required="true" placeholder="2000" valueLiveUpdate="true" change='clearFields' />
Controller.js
jQuery.sap.delayedCall(0, this, function() {
this.byId("in_lgort").focus()
});
I am learning SAPUi5 so please consider any corrections to my code regarding guidelines.
User | Count |
---|---|
80 | |
10 | |
10 | |
10 | |
10 | |
9 | |
8 | |
7 | |
6 | |
5 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.