cancel
Showing results for 
Search instead for 
Did you mean: 

StandartListItem on IconTabFIlter

Former Member
0 Kudos

Hi im trying to create standatListItem with "Notes" data in iconTabFilter but cant access data from json file.

XML view:

<IconTabBar

      class="iconTabBarPaddingTop" >

       <items>

            <IconTabFilter

                 id="SupplierForm"

                 icon="sap-icon://notes">

                 <content>

                      <List items="/Notes">

                           <StandardListItem

                                type="Active"

                                tap= "onListItemTap"

                                title="{Author}" />

                      </List>

                 </content>

               </IconTabFilter>

  </IconTabBar>

on Controller :

onBeforeRendering:function(){

       this.byId("SupplierForm").bindElement("Notes");

  },

Thx for help

Accepted Solutions (0)

Answers (1)

Answers (1)

former_member182372
Active Contributor
0 Kudos

try


this.byId("SupplierForm").bindElement("/");


and is your json model set as core  ?


sap.ui.getCore().setModel()

Former Member
0 Kudos

Nop still not working 😕

yes its set as core

var oModel = new sap.ui.model.json.JSONModel("model/contacts.json");  

    sap.ui.getCore().setModel(oModel);

former_member182372
Active Contributor
0 Kudos

put

this.byId("SupplierForm").bindElement("/");


not in onBeforeRendering:


but right after


var oModel = new sap.ui.model.json.JSONModel("model/contacts.json"); 

    sap.ui.getCore().setModel(oModel);

Former Member
0 Kudos

Still nothing 😕

But when I  <List items="/Notes"> change to <List items="/contents/0/Notes">  its showing notes of first json object. Now i cant figure out how change it to show not just the first object notes


BTW oModel i declare in aplication.js file where my app are initialized


former_member182372
Active Contributor
0 Kudos

so you need to display all Notes from all content elemnts? you cant do it by simple binding

what you can do

Object.defineProperty(sap.ui.getCore().getModel().getData(), "AllNotes", {

    get: function () {

        return $.map(sap.ui.getCore().getModel().getData().content,

        function (val, i) {

            return val.Notes;

        });

    }

});

this.byId("SupplierForm").bindElement("/AllNotes");

Former Member
0 Kudos

Sry for my eng in JSON file i contain data about contacts, and they have notes so in contacts page i create IconTabFilter where notes associated with them will be displayed. Hope u understand what i trying to do

former_member182372
Active Contributor
0 Kudos

<IconTabBar

      class="iconTabBarPaddingTop" items="/contents">

      ....

<List items="Notes">

Former Member
0 Kudos

Thx its working now

former_member182372
Active Contributor
0 Kudos

well, close the thread 🙂