Skip to Content
0

how to set focus textbox in sapui5

Feb 05 at 08:32 AM

86

avatar image
Former Member

I need to know how to autofocus textbox by loading the page

10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

2 Answers

Sagarika Gattu Feb 05 at 11:02 AM
0

Hello ,

Use the below code, if you have designed the page in javascript

jQuery.sap.delayedCall(500, this, function() {

sap.ui.getCore().byId("name").focus();

});

If the you have used XML view, write the below code in init function of the respective control.

jQuery.sap.delayedCall(500, this, function() {

this.getView().byId("name").focus();

});

Show 2 Share
10 |10000 characters needed characters left characters exceeded
Former Member

but it not fire when form load focusing last wizard step.

how can I resolve it

0
Former Member

onInit: function() {

jQuery.sap.delayedCall(500, this, function() { sap.ui.getView().byId("asd").focus(); }); }

0
Prachi Chaskar Feb 20 at 07:12 AM
0

Hi,

instead of onInit, write the function in "onBeforeRendering",

try this:

onBeforeRendering: function() {

jQuery.sap.delayedCall(500, this, function() { sap.ui.getView().byId("asd").focus(); }); }

Share
10 |10000 characters needed characters left characters exceeded