Quantcast
Channel: SCN : Unanswered Discussions - Data Services and Data Quality
Viewing all articles
Browse latest Browse all 3719

How could i access different view controls by sap.ui.getCore().byId() ? it doesn't work it shows an error

$
0
0

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.



Viewing all articles
Browse latest Browse all 3719

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>