cancel
Showing results for 
Search instead for 
Did you mean: 

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

Former Member
0 Kudos

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??

Accepted Solutions (1)

Accepted Solutions (1)

SergioG_TX
Active Contributor
0 Kudos

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 https://sapui5.netweaver.ondemand.com/#docs/api/symbols/sap.ui.html 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 https://archive.sap.com/discussions/thread/3551589

hope this helps

Answers (0)