I cannot access elements via byId() from different view/controller.
I am trying to access another view elements by using below syntax.
sap.ui.getCore().byId("xxx").setModel(oModel2);
But it shows error like (Cannot read property 'setModel' of undefined).
I found some answ in SCN blog they said that
When you do createID('XY'), the element is created with an ID havinbg format <prefix>XY . The prefix is that of the view. So when you do sap.ui.getCore().byId('XY'), you will not find any element with ID 'XY'.
Please help me. How could i achieve.