Skip to Content

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

Access List in Controller [MVC]

hi all.

my xml view;

<core:View xmlns:core="sap.ui.core" xmlns:mvc="sap.ui.core.mvc" xmlns="sap.m"

  controllerName="sapui5.appView" xmlns:html="http://www.w3.org/1999/xhtml">

  <Page title="UI5 Telefon Rehberi">

  <content>

          <List

            id="contactList"

     items="{/}"

     >

     <StandardListItem

       type="Navigation"

       press="handlePress"

       />

   </List>

  </content>

  </Page>

</core:View>

i try access this list;

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

list undefined.please help me.i will be set data this list.

var list = new sap.m.List();

   list.bindAggregation("items",{path:'/', template : oItemTemplate,

  sorter : oNameSorter});

bla bla.

Tags:
Former Member
Former Member replied

solution;

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

  list.bindAggregation("items",{path:'/', template : oItemTemplate,

  sorter : oNameSorter});

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