cancel
Showing results for 
Search instead for 
Did you mean: 

SAP UI5, XML view in Fragment, Model access and double result lines

0 Kudos

Hi UI Experts,

I have a really strange effect which I could not clarifiy:

UI5 Worklist view

Navigation to detail via router

In the detail an Icon Tab bar

One Icon in the Tab bar with an own event handler. After pressing the event handler, an own ODATA Model should be bound to the TableList within the icon tab.

Problem:
The result lines in the column list item table are doubled !
Definitely the ODATA service returns 2 different result items.

============================

XML view in the UI5 fragment:

Table id="My_Movement" items="{ path: '/TrackingMessageSet' }" width="auto"

============================

Controller:

onTabSelect: function(oEvent) {

var aANDFilter = [];

var sTabKey = oEvent.getParameter("selectedKey");

if (sTabKey === "TabMovement")

{

var oBindingContext = this.getView().getBindingContext();

var sObjectGuid = oBindingContext.getProperty("Guid");

var oModelTrack = this.getOwnerComponent().getModel("Tracking");

var oTable = this.getView().byId(sap.ui.core.Fragment.createId("Movement", "My_Movement") );

aANDFilter.push(new sap.ui.model.Filter("Guid", sap.ui.model.FilterOperator.EQ, sObjectGuid));

var oBinding = oTable.getBinding("items");

oBinding.filter(aANDFilter);

}

},

=============================

When the event handler runs, the ODATA / GW Service is accessed and the filter value by GUID is given. All OK. But the result lines are doubled...

In standard the router gives the detail view (my icon tab bar) access to the (Master-View)-model data, just selected.

But I simply want to bind a different ODATA model to the ColumnListItem. Model is defined in manifest.json.

Does anybody have a clue, where the effect of doubled result lines could come from !?

Thanks in advance

Klaus

Accepted Solutions (0)

Answers (1)

Answers (1)

OMG !

After nearly one week try and SCN search I found the problem. Who ever is facing doubled result lines in ODATA list/table binding result list,

have a look to your SAP GW service:

During creation of a GW service I used an reference ABAP structure.

For my specific purpose, I only needed a few fields. These fields I filled in the GetEntitiySet of SAP GW.

Problem:
=======
In the GW service the field "Guid" was marked as a Key !!! and was not filled by GetEntitySet of the GW service.

This caused the doubled/same result lines.