Skip to Content
avatar image
Former Member

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

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

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

1 Answer

  • Best Answer
    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 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

    Add comment
    10|10000 characters needed characters exceeded