cancel
Showing results for 
Search instead for 
Did you mean: 

How to bind a property in sap.ui.table.Table with parameter expand

Former Member
0 Kudos

This is my first post, so please be tolerantly and feel free to correct me 🙂

Scenario describing:

I've got a SalesCollection('ID') with a DocumentCollection and I show the DocumentCollection in a table (sap.ui.table.Table). To bind rows i use the path "/SalesCollection('ID')/GetDocuments". And at least I'm binding the properties.

That all works very well :-). Now i've got a new requisition. Every document of DocumentCollection has more details. I want to use one of this details in the DocumentCollection table. So I add expand to the table (see picture).

I looked at the browser debugger and the details are loading. Separately I checked the sendet URLs in my browser as XML => all details there.

My question is: How to bind the detail properties of documents. I tried: "GetDetail/DOC_SIZE" and "DOC_SIZE", but both don't work.

Has anyone an idea?

Accepted Solutions (0)

Answers (3)

Answers (3)

Former Member
0 Kudos

<List

  id="list"

  mode="{device>/listMode}"

  select="handleListSelect"

  items="{path: '/HeaderSet', parameters: {expand: 'TextLines,Items/ServiceLines,Items/Accounts,Items/AddrDeliverys,Items/TextLines'}}" >

former_member293602
Active Participant
0 Kudos

Hi Max,

I can't see what could be wrong on your side. Here is a small, complete example which works fine on my side:

var url = "/SimpleTableNorthwindExpand/proxy/http/services.odata.org/Northwind/Northwind.svc/";

var oModel = new sap.ui.model.odata.ODataModel(url, true);
sap.ui.getCore().setModel(oModel);


var oTable = new sap.ui.table.Table("table", { // create Table UI
title: "Northwind - Orders",
columns : [
  {label: "ID", template: "OrderID"  },  
  {label: "Date", template: "OrderDate" },
  {label: "Contact Name", template: "Customer/ContactName"}
]
});
   
oTable.bindRows({
path: "/Orders",
parameters: {
  expand:"Customer"
  }
}); // bind the table rows

oTable.placeAt("content"); // place Table onto UI

Hope it works for you too.

Regards, Frank

Former Member
0 Kudos

Hi,

can you post the oData response of a expanded call. I am doing something similar but I have a kind of a tree structure. So I am just passing the array names that I am want to bind to the table :

oTable.bindRows({

path :

"/",

parameters : {

arrayNames : [

"results" ]

}

});


}