cancel
Showing results for 
Search instead for 
Did you mean: 

help for binding text in sap.m.text

Former Member
0 Kudos

Hi,

I am trying to Bind text property of sap.m.Text but i am not successful.Please help me on this.

I am not getting any error in console same time not getting the output i.e names

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

  var oData = [{name : "jagadeesh",surname : "biyyapu","count":1 },

              {name : "jagadeesh",surname : "biyyapu" ,"count":2}];

oModel.setData(oData);

var soid1 = new sap.m.Text().bindText("{name}");

soid1.setModel(oModel);

return soid1;

Accepted Solutions (1)

Accepted Solutions (1)

PMarti
Active Participant
0 Kudos

Hi Jagadeesh, you cannot bind an array data.. that is oData = [{}.{}..] directly in a Text control, for that you need put text control inside a list an use bindAggregation and templates for do that.

I show you two examples what may be help you : Example 1 and Example 2

Regads,

Pau

Former Member
0 Kudos

thank You

Answers (1)

Answers (1)

former_member182862
Active Contributor
0 Kudos

Hi

There are a few ways to do this.


Example

-D

Former Member
0 Kudos

Thank You