Skip to Content

Difference between sap.ui.getCore().byId vs sap.ui.getCore().byId(this.createId("btn1"));

Dec 12, 2016 at 03:24 PM


avatar image
Former Member

Hi Experts,

In my previous custom UI5 applications, I need to get the ID by using "sap.ui.getCore().byId" its working fine, currently using the same syntax we are unable to get the ID. Instead of that use the"createId" method able to get the ID.

Is this method deprecated ("sap.ui.getCore().byId") why it is not working any one of you please help me about this??

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

1 Answer

Best Answer
Sergio Guerrero Dec 14, 2016 at 03:47 PM

any deprecated feature will be based on the version of sapui5 you are using. to see whether a feature / property / method is deprecated, you can access the sdk api reference make sure are looking at the correct version.

now if your sap.ui.getCore().byId is not working anymore and you need to get a handle of a control, you can use this js from a controller: this.getView().byId('youControlId') -- making sure this is in the right scope and refers to the controller you are using

here is a similar post

hope this helps

10 |10000 characters needed characters left characters exceeded