Skip to Content
0
Former Member
May 02, 2014 at 07:36 AM

Binding gateway service with List not working properly with expand

37 Views

Hi all,

We have an orderlist with details, we use the splitapp for it, it's working nicely with a gatewayservice. We have now added with expand 2 orderpartners. I see the 2 partners, only is it completly the same data. I checked the oData structure and I see indeed that the 2 partners are the same. This is weird, because when I execute the service, via my browser, I see 2 different partners.

If I execute the service directly via the read function, I see in the oData that I also have 2 different partners. So my conclusion is that the direct read of the service is working and executing the service via the sap.m.List is not working with the expand.

Now my question is, does somebody know what's going wrong here, or is it a bug in the sap.m.List? Below you find code snippets how I call the service.

This call is working:

oModel.read("/OrderListSet", null, ["$orderby=BegTstmp asc&$filter=Userid eq 'user' and DateFrom eq datetime'2014-04-20T00:00:00' and DateTo eq datetime'2014-04-27T00:00:00'&$expand=OrderPartners"], null, function(oData, oResponse){

}, null );

The binding via the sap.m.list is:

var oList = new sap.m.List("orderList", {

mode: "{device>/listMode}",

items: {

path: "/OrderListSet",

parameters: {expand: "OrderPartners"},

template : new sap.m.StandardListItem({

title: {

parts: [

{path: "BegTstmp", type: new sap.ui.model.type.DateTime({pattern: "H:mm"})},

{path: "DataCol2"}

],

formatter : function(strDate, strDescription) { return strDate + " - " + strDescription; }

},

description: {

parts: [

"DataCol3",

"DataCol4",

"DataCol5",

"DataCol6"

]

},

type: sap.m.ListType.Navigation,

icon: "{icon}",

customData: [

new sap.ui.core.CustomData({

key: "orderId",

value: "{Orderid}"

}),

new sap.ui.core.CustomData({

key: "type",

value: "{Type}"

}),

],

}),

// Sort the list on date and group the list on day

sorter: new sap.ui.model.Sorter("BegTstmp", false, oGrouper),

// Filter the list, this directly refrenced to the gatewayservice

filters: [

util.Filter.getUserId(),

util.Filter.getCurrentWeekFromFilter(),

util.Filter.getCurrentWeekToFilter(),

]

}

});