Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

TextField binding with Odata model

Hi All,

I need your help here. I followed thread  Simple OData Binding with SAPUI5 in order to bind my control Text field with Odata model but  am still not able to get data in my TEXT FIELD from my Odata model 

Surprisingly I am getting model data in UI if i use Table but not getting when I try to show in TextField inside a matrix layout.

/***** myView.js***********************/

var oModel = new sap.ui.model.odata.ODataModel("/SIVA/services/CusustomerData.xsodata/", true);

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

  var oCell = new sap.ui.commons.layout.MatrixLayoutCell();

  var oTextField  =  new sap.ui.commons.TextField("tko_plan",{value: "{FirstName}"});    //FirstName is column name

  oTextField.bindElement("/Customer"); // Customer is name of the Odata entity

  oTextField.placeAt("content");

  oCell.addContent(oTextField);

  oCell.setModel(oModel);

  oRow.addCell(oCell);

  oLayout.addRow(oRow);

  oLayout.addRow(oRow);

        return oLayout;

Any help would be appreciated!

Thanks

Siva

Tags:
Former Member
Not what you were looking for? View more on this topic or Ask a question