Like the title said, I've got a simple question in the scope of best practis / good coding. In my component, I often need to access elements from the view. So now I'm wondering, if I should use the sap.ui.getCore().byId(ID)
method to get my elemnt or the this.getView().byId(ID)
operator. I thought maybe it's no matter which of the two I choose, but I want to learn more about this whole sapui5 content and maybe there is an answer way to prefer one solution.
EDIT:
Maybe I was not clear enough with my request and now it's corrected wrong. My question is in the scope of a component. So I wanted to know if I should acces my elemnts by the this
operator or by sap.ui.getCore().byId(ID)
. I know what the this operator is and so on, but I don't know, which variant is "clearer":