Skip to Content
avatar image
Former Member

help for binding text in sap.m.text

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;

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

2 Answers

  • Best Answer
    avatar image
    Former Member
    Jan 03, 2015 at 08:40 PM

    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

    Add comment
    10|10000 characters needed characters exceeded

  • Jan 03, 2015 at 08:41 PM

    Hi

    There are a few ways to do this.


    Example

    -D

    Add comment
    10|10000 characters needed characters exceeded