Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

Accessing elements of different views

Hi all,

I am having an issue accessing elements that are located in views different by the one of the control that I am using.

In order to explain better this is the code.

  • This code works, when I am inside the controllor of the view that contains the list:

     var oList = this.getView().byId("list");

     var items = oList.getItems();

  • This code doesn't work becasue I am trying to get the items from a list that is in a different view.

     var oList = sap.ui.getCore().byId("list");       

     var items = oList.getItems();

The error that I receive is:

Cannot read property 'getItems' of undefined

Thanks in advance for your help.

Helpful Answer

Not what you were looking for? View more on this topic or Ask a question