Quantcast
Channel: SCN : All Content - All Communities
Viewing all articles
Browse latest Browse all 3441

XML view data binding to Json model

$
0
0

Hi All,

 

Trying to get some data binding to work, it seems to work well for tables and lists, but...

 

If I have a json model like this -

 

var demoJSONModel = new sap.ui.model.json.JSONModel({

  data : [

    { id : 42, name : "Kevin" , telnr: "555 1234"},

    { id : 43, name : "Bob" , telnr: "555 1235"},

    { id : 43, name : "Stuart" , telnr: "555 1235"},

  ]

});

oView.setModel(demoJSONModel,"dataModel");

 

If I wanted a <text> with the value - 'Bob' what would my syntax be...

 

I have tried several options but no luck:

<Text text="{dataModel(2)>name}"/>

<Text text="{dataModel(2)/name}"/>

<Text text="{dataModel>name(2)}"/>


Thanks!


Viewing all articles
Browse latest Browse all 3441