Reputation: 23
i am new to SAPUI5 and got a problem with displaying the contents of my model.
For example, i am setting a model with following JSON:
var a = new sap.ui.model.json.JSONModel({
name: 'testtttt',
test : [ {
val : 1
}, {
val : 2
} ],
test2: [1,2,3,4]
});
a.setDefaultBindingMode("OneWay");
this.setModel(a, 'test');
Now, in the XML View i am trying to display it via Listitem:
<List items="{test>/test}">
<items>
<StandardListItem title="{val}" description="{val}"></StandardListItem>
</items>
</List>
The result are two lines of blank Listitems without content
Any ideas :( ?
Upvotes: 0
Views: 901
Reputation: 1454
You need to tell the StandardListItem to use the test
-model:
<List items="{test>/test}">
<items>
<StandardListItem title="{test>val}" description="{test>val}"></StandardListItem>
</items>
</List>
Upvotes: 2